Skip to content

Commit 533761c

Browse files
committed
Fixed bugs
1 parent 7a3e3d4 commit 533761c

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

src/test/java/common/EnvUtil.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public final class EnvUtil {
1515

1616
static {
1717
try {
18-
String args = getEnv(Const.Config.ARGS_JSON);
18+
String args = getEnv(Const.Config.ARGS_JSON, false);
1919

2020
if (StringUtils.isNotBlank(args)) {
2121
TypeReference<HashMap<String, String>> typeRef = new TypeReference<>() {
@@ -31,17 +31,21 @@ public final class EnvUtil {
3131
private EnvUtil() {
3232
}
3333

34-
public static String getEnv(String env) {
34+
public static String getEnv(String env, boolean required) {
3535
String value = System.getenv(env);
3636
if (StringUtils.isBlank(value)) {
3737
value = ARGS.get(env);
3838
}
3939

40-
if (StringUtils.isBlank(value)) {
40+
if (StringUtils.isBlank(value) && required) {
4141
LOGGER.error(() -> "Missing environment variable: " + env);
4242
System.exit(1);
4343
}
4444

4545
return value;
4646
}
47+
48+
public static String getEnv(String env) {
49+
return getEnv(env, true);
50+
}
4751
}

src/test/java/suite/core/CoreRefreshTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import static org.junit.jupiter.api.Assertions.*;
1414

15-
@EnabledIf("helper.EnabledCondition#isLocal")
15+
@EnabledIf("common.EnabledCondition#isLocal")
1616
public class CoreRefreshTest {
1717
@ParameterizedTest(name = "Refresh test - UrlPath: {1} - JsonPath: {2}")
1818
@MethodSource({"suite.core.TestData#refreshArgs", "suite.core.TestData#refreshArgsEncrypted"})

src/test/java/suite/core/CoreTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
import static org.junit.jupiter.api.Assertions.*;
1414

15-
@EnabledIf("helper.EnabledCondition#isLocal")
15+
@EnabledIf("common.EnabledCondition#isLocal")
1616
public class CoreTest {
1717
@ParameterizedTest(name = "/attest - {0}")
1818
@MethodSource({

src/test/java/suite/operator/V2ApiOperatorLocalOnlyTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import static org.junit.jupiter.api.Assertions.assertAll;
1818
import static org.junit.jupiter.api.Assertions.assertTrue;
1919

20-
@EnabledIf("helper.EnabledCondition#isLocal")
20+
@EnabledIf("common.EnabledCondition#isLocal")
2121
public class V2ApiOperatorLocalOnlyTest {
2222
@ParameterizedTest(name = "{index} ==> Sender {0} encrypts with {1}, recipient {2} decrypts with {3}, expected result is {4}")
2323
@MethodSource({

0 commit comments

Comments
 (0)