diff options
author | 2017-10-03 04:04:30 -0400 | |
---|---|---|
committer | 2017-10-03 04:04:30 -0400 | |
commit | 119808a2ded9ea8c4dd9d1eef96f39ab2e001ff7 (patch) | |
tree | 9b4cba39211ce2d0ce340ac47ef8ca8c37106b1d /ueb-listener/src/main | |
parent | 1ed66a39f23e8db43adf065a349ab7940292dd2a (diff) |
Add unit test for ueb-listener
Add unit test case for ueb-listener.
Change-Id: Ia61f8e5bc0e817aa0f4a042d8e05b02ec9e2013b
Issue-ID: CCSDK-106
Signed-off-by: Dan Timoney <dtimoney@att.com>
Diffstat (limited to 'ueb-listener/src/main')
2 files changed, 20 insertions, 6 deletions
diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java index f25ce145..f00d7372 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebCallback.java @@ -1073,6 +1073,10 @@ public class SdncUebCallback implements INotificationCallback { } private String escapeFilename(String str) { + + if (str == null) { + str = ""; + } StringBuffer retval = new StringBuffer(); for (int i = 0 ; i < str.length() ; i++) { diff --git a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java index 4d9c8246..d97abacb 100644 --- a/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java +++ b/ueb-listener/src/main/java/org/onap/ccsdk/sli/northbound/uebclient/SdncUebConfiguration.java @@ -82,21 +82,31 @@ public class SdncUebConfiguration implements IConfiguration{ } public SdncUebConfiguration() { + String propDir = System.getenv(SDNC_CONFIG_DIR); + if (propDir == null) { + + propDir = "/opt/sdnc/data/properties"; + } + try { + init(propDir); + } catch (Exception e) { + LOG.error("Cannot initialize SdncUebConfiguration", e); + } + } + public SdncUebConfiguration(String propDir) { try { - init(); + init(propDir); } catch (Exception e) { LOG.error("Cannot initialize SdncUebConfiguration", e); } } - public void init() throws IOException { + + public void init(String propDir) throws IOException { String propPath; - String propDir = System.getenv(SDNC_CONFIG_DIR); - if (propDir == null) { - propDir = "/opt/sdnc/data/properties"; - } + propPath = propDir + "/ueb-listener.properties"; File propFile = new File(propPath); |