diff options
author | 2018-08-02 12:50:09 +0100 | |
---|---|---|
committer | 2018-08-02 12:50:35 +0100 | |
commit | e4da736f34d7f1fc91fb1370d29f927a9e2ebe2d (patch) | |
tree | eb8bdb7dfec67512a38e373d0ae16c2a5a103f73 /client/client-editor/src/test/java/org/onap | |
parent | 9e318f20f2e64970bf3c2e3a5532c516231a6f8a (diff) |
Fixing sonar vulnerabilities in apex-pdp
Changed the Console class to use logger only for printing stack trace,
as the class is meant to be used for CLI usage.
Changed the CLIParser to use Console class for printing messages.
Changed the client-editor to be hosted on localhost by default, to follow
the same what others clients (deployment, monitoring & client full) are doing.
Change-Id: I6565b4b35a93b3708b926bfee04d79ead6b5346e
Issue-ID: POLICY-954
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
Diffstat (limited to 'client/client-editor/src/test/java/org/onap')
-rw-r--r-- | client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java index 0ae54e5af..d61d43b01 100644 --- a/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java +++ b/client/client-editor/src/test/java/org/onap/policy/apex/client/editor/rest/TestApexEditorStartup.java @@ -48,13 +48,13 @@ public class TestApexEditorStartup { final String outString = runEditor(args); assertTrue(outString.startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=-1sec], " - + "State=READY) starting at http://0.0.0.0:18989/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], " + + "State=READY) starting at http://localhost:18989/apexservices/")); assertTrue(outString.contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=-1sec], " - + "State=RUNNING) started at http://0.0.0.0:18989/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], " + + "State=RUNNING) started at http://localhost:18989/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); } /** @@ -207,13 +207,13 @@ public class TestApexEditorStartup { final String outString = runEditor(args); assertTrue(outString.startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], " - + "State=READY) starting at http://0.0.0.0:12321/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + + "State=READY) starting at http://localhost:12321/apexservices/")); assertTrue(outString.contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], " - + "State=RUNNING) started at http://0.0.0.0:12321/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + + "State=RUNNING) started at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); } /** @@ -229,13 +229,13 @@ public class TestApexEditorStartup { final String outString = runEditor(args); assertTrue(outString.startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], " - + "State=READY) starting at http://0.0.0.0:12321/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + + "State=READY) starting at http://localhost:12321/apexservices/")); assertTrue(outString.contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], " - + "State=RUNNING) started at http://0.0.0.0:12321/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], " + + "State=RUNNING) started at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("(ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=-1sec], State=STOPPED) shut down ")); } @@ -274,7 +274,7 @@ public class TestApexEditorStartup { } catch (final Exception e) { assertTrue(e.getMessage() .startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:0/apexservices/, TTL=-1sec], " + + "Config=[ApexEditorParameters: URI=http://localhost:0/apexservices/, TTL=-1sec], " + "State=STOPPED) parameters invalid, port must be between 1024 and 65535")); } } @@ -295,7 +295,7 @@ public class TestApexEditorStartup { } catch (final Exception e) { assertTrue(e.getMessage() .startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:1023/apexservices/, TTL=-1sec], " + + "Config=[ApexEditorParameters: URI=http://localhost:1023/apexservices/, TTL=-1sec], " + "State=STOPPED) parameters invalid, port must be between 1024 and 65535")); } } @@ -316,7 +316,7 @@ public class TestApexEditorStartup { } catch (final Exception e) { assertTrue(e.getMessage() .startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:65536/apexservices/, TTL=-1sec], " + + "Config=[ApexEditorParameters: URI=http://localhost:65536/apexservices/, TTL=-1sec], " + "State=STOPPED) parameters invalid, port must be between 1024 and 65535")); } } @@ -334,12 +334,12 @@ public class TestApexEditorStartup { final String outString = runEditor(args); assertTrue(outString.startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=10sec], " - + "State=READY) starting at http://0.0.0.0:18989/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], " + + "State=READY) starting at http://localhost:18989/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=RUNNING) started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:18989/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:18989/apexservices/, TTL=10sec], State=STOPPED) shut down ")); } /** @@ -376,12 +376,12 @@ public class TestApexEditorStartup { final String outString = runEditor(args); assertTrue(outString.startsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=10sec], " - + "State=READY) starting at http://0.0.0.0:12321/apexservices/")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], " + + "State=READY) starting at http://localhost:12321/apexservices/")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").contains("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=10sec], State=RUNNING) started")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=RUNNING) started")); assertTrue(outString.replaceAll("[\\r?\\n]+", " ").endsWith("Apex Editor REST endpoint (ApexEditorMain: " - + "Config=[ApexEditorParameters: URI=http://0.0.0.0:12321/apexservices/, TTL=10sec], State=STOPPED) shut down ")); + + "Config=[ApexEditorParameters: URI=http://localhost:12321/apexservices/, TTL=10sec], State=STOPPED) shut down ")); } |