diff options
author | 2019-03-11 15:37:58 +0000 | |
---|---|---|
committer | 2019-03-11 15:37:58 +0000 | |
commit | be689ed12e6f35dd98606cb5561433c1275d44a8 (patch) | |
tree | 28deaff9303295e3a384c34b02277c15854b959f /src/test | |
parent | e8bb310641941ddbb073df33d92cfbe6f6029029 (diff) |
Test starting application with OBF: password
Test an uncovered code path. Remove the unnecessary declaration of the
Jetty OBF: prefix constant String. Ensure that the Spring Application
exits before the next JUnit test runs.
Change-Id: Iceb2e79a923359c15ca6ad366c2ac94a63e381b0
Issue-ID: AAI-2229
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/onap/aai/babel/TestApplication.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/java/org/onap/aai/babel/TestApplication.java b/src/test/java/org/onap/aai/babel/TestApplication.java index 2821dc1..8c9ca5e 100644 --- a/src/test/java/org/onap/aai/babel/TestApplication.java +++ b/src/test/java/org/onap/aai/babel/TestApplication.java @@ -22,6 +22,7 @@ package org.onap.aai.babel; import java.io.IOException; +import org.eclipse.jetty.util.security.Password; import org.hamcrest.Description; import org.hamcrest.TypeSafeMatcher; import org.junit.Before; @@ -36,6 +37,9 @@ public class TestApplication { @Rule public ExpectedException expectedEx = ExpectedException.none(); + /** + * Initialize System Properties. + */ @Before public void init() { System.setProperty("APP_HOME", "."); @@ -47,6 +51,14 @@ public class TestApplication { public void testApplicationStarts() { System.setProperty("KEY_STORE_PASSWORD", "password"); BabelApplication.main(new String[] {}); + BabelApplication.exit(); + } + + @Test + public void testApplicationStartsWithObfuscatedPassword() { + System.setProperty("KEY_STORE_PASSWORD", Password.obfuscate("password")); + BabelApplication.main(new String[] {}); + BabelApplication.exit(); } @Test |