This commit is contained in:
parent
fb14eef179
commit
7b602a0f21
@ -43,15 +43,11 @@ public final class EnvironmentUtils {
|
|||||||
|
|
||||||
static {
|
static {
|
||||||
// Are we running on production?
|
// Are we running on production?
|
||||||
String env = System.getenv("APP_ENV");
|
String appEnv = System.getenv("APP_ENV");
|
||||||
production = env != null && (env.equals("production"));
|
production = appEnv != null && (appEnv.equals("production"));
|
||||||
|
|
||||||
// Are we running in a test?
|
// Are we running on a test environment?
|
||||||
try {
|
String testEnv = System.getenv("SPRING_TEST");
|
||||||
Class.forName("org.junit.jupiter.engine.JupiterTestEngine");
|
testing = testEnv != null && (testEnv.equals("true"));
|
||||||
testing = true;
|
|
||||||
} catch (ClassNotFoundException ignored) {
|
|
||||||
// Safely ignore
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user