diff options
author | 2018-08-15 10:26:43 -0400 | |
---|---|---|
committer | 2018-08-15 10:29:42 -0400 | |
commit | 705c39c8274ceefebe0d8fd6c7bcd741e1bb6797 (patch) | |
tree | c634d51de2f937ea896662a0fae301dbd75b2706 /pomba/network-discovery/src/test | |
parent | 41a3f1b3b0e14fb1df40273adb4b4b1937c5a977 (diff) |
Added code for password obfuscation(v2)
Issue-ID: SDNC-317
Change-Id: Ic6125feb917878f8edaf34a1f396826401173022
Signed-off-by: Mohammadreza Pasandideh <mohammadreza.pasandideh@amdocs.com>
Diffstat (limited to 'pomba/network-discovery/src/test')
-rw-r--r-- | pomba/network-discovery/src/test/java/org/onap/sdnc/apps/pomba/networkdiscovery/unittest/service/NetworkDiscoveryTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pomba/network-discovery/src/test/java/org/onap/sdnc/apps/pomba/networkdiscovery/unittest/service/NetworkDiscoveryTest.java b/pomba/network-discovery/src/test/java/org/onap/sdnc/apps/pomba/networkdiscovery/unittest/service/NetworkDiscoveryTest.java index 100c671..cd65b25 100644 --- a/pomba/network-discovery/src/test/java/org/onap/sdnc/apps/pomba/networkdiscovery/unittest/service/NetworkDiscoveryTest.java +++ b/pomba/network-discovery/src/test/java/org/onap/sdnc/apps/pomba/networkdiscovery/unittest/service/NetworkDiscoveryTest.java @@ -46,13 +46,14 @@ import javax.servlet.http.HttpServletRequest; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.Response; import javax.ws.rs.core.Response.Status; -import org.eclipse.jetty.util.security.Password; import org.junit.After; import org.junit.Before; import org.junit.Rule; import org.junit.Test; import org.junit.runner.RunWith; import org.onap.logging.ref.slf4j.ONAPLogConstants; +import org.onap.sdnc.apps.pomba.networkdiscovery.Application; +import org.onap.sdnc.apps.pomba.networkdiscovery.PropertyPasswordConfiguration; import org.onap.sdnc.apps.pomba.networkdiscovery.datamodel.Attribute; import org.onap.sdnc.apps.pomba.networkdiscovery.datamodel.DataQuality; import org.onap.sdnc.apps.pomba.networkdiscovery.datamodel.NetworkDiscoveryNotification; @@ -65,6 +66,7 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.core.env.Environment; +import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.TestPropertySource; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.web.WebAppConfiguration; @@ -76,8 +78,9 @@ import org.springframework.test.context.web.WebAppConfiguration; @TestPropertySource(properties = { "enricher.url=http://localhost:9505", "basicAuth.username=admin", - "basicAuth.password=OBF:1u2a1toa1w8v1tok1u30" + "basicAuth.password=password(OBF:1u2a1toa1w8v1tok1u30)" }) +@ContextConfiguration(initializers = PropertyPasswordConfiguration.class, classes = Application.class) public class NetworkDiscoveryTest { private static final String V1 = "v1"; private static final String APP = "junit"; @@ -85,8 +88,7 @@ public class NetworkDiscoveryTest { private static final String RESOURCE_TYPE_VSERVER = "vserver"; private static final String CALLBACK_PATH = "/callback"; - private static final String AUTH = "Basic " + Base64.getEncoder().encodeToString(( - "admin:" + Password.deobfuscate("OBF:1u2a1toa1w8v1tok1u30")).getBytes()); + private static final String AUTH = "Basic " + Base64.getEncoder().encodeToString(("admin:admin").getBytes()); @Autowired private Environment environment; @@ -189,7 +191,6 @@ public class NetworkDiscoveryTest { } } - @Test public void testVerifyResourceType() throws Exception { // no resource type |