diff options
author | 2018-09-24 13:19:03 +0000 | |
---|---|---|
committer | 2018-09-24 13:19:03 +0000 | |
commit | 0f82181e2621c414bbdaf6531696c5e25fe6ba9d (patch) | |
tree | e47ff288d4adfa1325aa8368bc00e6af6deb7b77 /sliPluginUtils/provider/src/test/java/org | |
parent | 6f0b890ba0c5b219a4470f6b7482393d60c636ed (diff) | |
parent | dd40efb6c50b80695a4bc645b3227e73ddc4c67d (diff) |
Merge "added test case to Dme2Test.java"
Diffstat (limited to 'sliPluginUtils/provider/src/test/java/org')
-rw-r--r-- | sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java index 9bff9483..a06def65 100644 --- a/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java +++ b/sliPluginUtils/provider/src/test/java/org/onap/ccsdk/sli/core/slipluginutils/Dme2Test.java @@ -3,7 +3,9 @@ * ONAP : CCSDK * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights - * reserved. + * reserved. + * ================================================================================ + * Modifications Copyright (C) 2018 IBM. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,6 +33,8 @@ import java.util.Map; import java.util.Properties; import org.junit.Assert; import org.junit.Test; +import org.onap.ccsdk.sli.core.sli.SvcLogicContext; +import org.onap.ccsdk.sli.core.sli.SvcLogicException; public class Dme2Test { public Properties makesProperties(String aafUserName, String aafPassword, String envContext, String routeOffer, @@ -279,5 +283,20 @@ public class Dme2Test { "http://sample.com:25055/service=sample.com/restservices/sys/v1/assetSearch/version=1.0/envContext=PROD/subContext=/mySubContext?dme2.password=fake&dme2.username=user@sample.com&partner=LPP_PROD&dme2.allowhttpcode=true"; assertEquals(expected, constructedUrl); } + + @Test + public void testConstructUrl() throws FileNotFoundException, IOException, SvcLogicException + { + Properties props = new Properties(); + props.load(new FileInputStream("src/test/resources/dme2.prod.properties")); + DME2 dme2 = new DME2(props); + Map<String, String> parameters= new HashMap<>(); + SvcLogicContext ctx= new SvcLogicContext(); + parameters.put(DME2.SERVICE_KEY, "sample.com/services/eim/v1/rest"); + parameters.put(DME2.OUTPUT_PATH_KEY, "tmp.test"); + dme2.constructUrl(parameters,ctx); + String expected= "http://sample.com:25055/service=sample.com/services/eim/v1/rest/version=1.0/envContext=PROD?dme2.password=fake&dme2.username=user@sample.com&partner=LPP_PROD&dme2.allowhttpcode=true"; + assertEquals(expected,ctx.getAttribute(parameters.get(DME2.OUTPUT_PATH_KEY))); + } } |