fix metric saving for running in tests
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m10s
All checks were successful
Deploy App / docker (ubuntu-latest, 2.44.0, 17, 3.8.5) (push) Successful in 2m10s
This commit is contained in:
@ -4,7 +4,7 @@ import lombok.Getter;
|
||||
import lombok.experimental.UtilityClass;
|
||||
|
||||
@UtilityClass
|
||||
public final class EnvironmentUtils {
|
||||
public final class AppConfig {
|
||||
/**
|
||||
* Is the app running in a production environment?
|
||||
*/
|
||||
@ -14,4 +14,17 @@ public final class EnvironmentUtils {
|
||||
String env = System.getenv("ENVIRONMENT");
|
||||
production = env != null && (env.equals("production"));
|
||||
}
|
||||
|
||||
/**
|
||||
* Is the app running in a test environment?
|
||||
*/
|
||||
@Getter
|
||||
private static boolean isRunningTest = true;
|
||||
static {
|
||||
try {
|
||||
Class.forName("org.junit.Test");
|
||||
} catch (ClassNotFoundException e) {
|
||||
isRunningTest = false;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user