From c2d5c19d4bd5b98ae0f8bd7e6bbc415890dfbb48 Mon Sep 17 00:00:00 2001 From: Bogumil Zebek Date: Mon, 23 Mar 2020 11:59:21 +0100 Subject: Improve code coverage Issue-ID: AAF-1107 Signed-off-by: Zebek Bogumil Change-Id: I117eefc86867f388509b56e19e6b1d0d78df9d0b --- .../org/onap/aaf/certservice/client/configuration/EnvProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'certServiceClient/src/main/java') diff --git a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/EnvProvider.java b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/EnvProvider.java index 25a152bf..1b8c3606 100644 --- a/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/EnvProvider.java +++ b/certServiceClient/src/main/java/org/onap/aaf/certservice/client/configuration/EnvProvider.java @@ -23,10 +23,14 @@ import java.util.Optional; public class EnvProvider { public Optional readEnvVariable(String envVariableName) { - return Optional.ofNullable(System.getenv(envVariableName)) + return Optional.ofNullable(getSystemEnv(envVariableName)) .filter(EnvProvider::isEnvPresent); } + String getSystemEnv(String envVariableName) { + return System.getenv(envVariableName); + } + private static Boolean isEnvPresent(String envValue) { return !"".equals(envValue); } -- cgit 1.2.3-korg