diff options
author | mark.j.leonard <mark.j.leonard@gmail.com> | 2019-01-22 12:42:30 +0000 |
---|---|---|
committer | mark.j.leonard <mark.j.leonard@gmail.com> | 2019-01-22 12:57:46 +0000 |
commit | 3d327a141936b42ac525fc44f08564d73863507f (patch) | |
tree | 185f4b42011178a7b234b4df24425e6e3dbfd9d4 /src/test/java | |
parent | 3ec58a16f80426968919fe5da42732bf693909e0 (diff) |
Use Jetty deobfuscation method on password strings
Change-Id: Ifc36d8358c54f2602ecab2fb965461a6436bfcae
Issue-ID: AAI-2110
Signed-off-by: mark.j.leonard <mark.j.leonard@gmail.com>
Diffstat (limited to 'src/test/java')
3 files changed, 7 insertions, 8 deletions
diff --git a/src/test/java/org/onap/aai/validation/config/TestRestConfig.java b/src/test/java/org/onap/aai/validation/config/TestRestConfig.java index 313c847..0c632ee 100644 --- a/src/test/java/org/onap/aai/validation/config/TestRestConfig.java +++ b/src/test/java/org/onap/aai/validation/config/TestRestConfig.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertTrue; import javax.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.aai.validation.config.RestConfig; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -48,9 +47,9 @@ public class TestRestConfig { expectedRestConfig.setProtocol("https"); expectedRestConfig.setBaseModelURI("${baseModelURI}"); expectedRestConfig.setTrustStorePath("/dir1/dir2/trustStorePath"); - expectedRestConfig.setTrustStorePassword("70c87528c88dcd9f9c2558d30e817868"); + expectedRestConfig.setTrustStorePassword("OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o"); expectedRestConfig.setKeyStorePath("/dir1/dir2/keyStorePath"); - expectedRestConfig.setKeyStorePassword("70c87528c88dcd9f9c2558d30e817868"); + expectedRestConfig.setKeyStorePassword("OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o"); expectedRestConfig.setKeyManagerFactoryAlgorithm("AES"); expectedRestConfig.setKeyStoreType("jks"); expectedRestConfig.setSecurityProtocol("TLS"); diff --git a/src/test/java/org/onap/aai/validation/config/TestTopicAdminConfig.java b/src/test/java/org/onap/aai/validation/config/TestTopicAdminConfig.java index f6a6195..8e24f3a 100644 --- a/src/test/java/org/onap/aai/validation/config/TestTopicAdminConfig.java +++ b/src/test/java/org/onap/aai/validation/config/TestTopicAdminConfig.java @@ -24,7 +24,6 @@ import static org.junit.Assert.assertTrue; import javax.inject.Inject; import org.junit.Test; import org.junit.runner.RunWith; -import org.onap.aai.validation.config.TopicAdminConfig; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @@ -44,9 +43,9 @@ public class TestTopicAdminConfig { TopicAdminConfig expectedTopicAdminConfig = new TopicAdminConfig(); expectedTopicAdminConfig.setPublishEnable(true); - expectedTopicAdminConfig.setPublishRetries(3l); + expectedTopicAdminConfig.setPublishRetries(3L); expectedTopicAdminConfig.setConsumeEnable(true); - expectedTopicAdminConfig.setConsumePollingIntervalSeconds(3l); + expectedTopicAdminConfig.setConsumePollingIntervalSeconds(3L); assertThat(expectedTopicAdminConfig, is(topicAdminConfig)); assertThat(expectedTopicAdminConfig.hashCode(), is(topicAdminConfig.hashCode())); diff --git a/src/test/java/org/onap/aai/validation/publisher/TestValidationEventPublisher.java b/src/test/java/org/onap/aai/validation/publisher/TestValidationEventPublisher.java index 8950e63..604312e 100644 --- a/src/test/java/org/onap/aai/validation/publisher/TestValidationEventPublisher.java +++ b/src/test/java/org/onap/aai/validation/publisher/TestValidationEventPublisher.java @@ -31,6 +31,7 @@ import org.onap.aai.validation.publisher.ValidationEventPublisher; import java.util.ArrayList; import java.util.Collection; import java.util.List; +import org.eclipse.jetty.util.security.Password; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; @@ -56,12 +57,12 @@ public class TestValidationEventPublisher { TopicAdminConfig mockTopicAdminConfig = Mockito.mock(TopicAdminConfig.class); when(mockTopicAdminConfig.isPublishEnable()).thenReturn(true); - Topic topic1 = new TopicConfig("poa-rule-validation","poa-audit-result").new Topic(); + Topic topic1 = mockTopicConfig.new Topic(); topic1.setName("aai-data-integrity"); topic1.setHost("integrity-dummy-host"); topic1.setPartition("integrity-dummy-partition"); topic1.setUsername("integrity-dummy-username"); - topic1.setPassword("integrity-dummy-password"); + topic1.setPassword(Password.obfuscate("integrity-dummy-password")); topic1.setTransportType("integrity-dummy-transport-type"); topicList.add(topic1); |