From 7b602a0f2190de0022e9fbbe57e13ba87dce426d Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Mon, 22 Apr 2024 23:07:46 -0400 Subject: [PATCH] Fix test errs --- .../me/braydon/mc/common/EnvironmentUtils.java | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/API/src/main/java/me/braydon/mc/common/EnvironmentUtils.java b/API/src/main/java/me/braydon/mc/common/EnvironmentUtils.java index 6d53ee6..7f8812f 100644 --- a/API/src/main/java/me/braydon/mc/common/EnvironmentUtils.java +++ b/API/src/main/java/me/braydon/mc/common/EnvironmentUtils.java @@ -43,15 +43,11 @@ public final class EnvironmentUtils { static { // Are we running on production? - String env = System.getenv("APP_ENV"); - production = env != null && (env.equals("production")); + String appEnv = System.getenv("APP_ENV"); + production = appEnv != null && (appEnv.equals("production")); - // Are we running in a test? - try { - Class.forName("org.junit.jupiter.engine.JupiterTestEngine"); - testing = true; - } catch (ClassNotFoundException ignored) { - // Safely ignore - } + // Are we running on a test environment? + String testEnv = System.getenv("SPRING_TEST"); + testing = testEnv != null && (testEnv.equals("true")); } } \ No newline at end of file