Skip to content

Commit 7a3e3d4

Browse files
committed
Updated args loading
1 parent 2e9d686 commit 7a3e3d4

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/java/common/EnvUtil.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,20 @@
1111

1212
public final class EnvUtil {
1313
private static final Logger LOGGER = LoggerFactory.getLogger(EnvUtil.class);
14-
private static final Map<String, String> ARGS;
14+
private static final Map<String, String> ARGS = new HashMap<>();
1515

1616
static {
1717
try {
1818
String args = getEnv(Const.Config.ARGS_JSON);
19-
TypeReference<HashMap<String,String>> typeRef = new TypeReference<>() {};
20-
ARGS = Mapper.OBJECT_MAPPER.readValue(args, typeRef);
19+
20+
if (StringUtils.isNotBlank(args)) {
21+
TypeReference<HashMap<String, String>> typeRef = new TypeReference<>() {
22+
};
23+
ARGS.putAll(Mapper.OBJECT_MAPPER.readValue(args, typeRef));
24+
}
2125
} catch (JsonProcessingException e) {
22-
throw new RuntimeException(e);
26+
LOGGER.error(e::getMessage);
27+
System.exit(1);
2328
}
2429
}
2530

0 commit comments

Comments
 (0)