From 96119e62a35496ecb0093c0f55300dffb95c8d33 Mon Sep 17 00:00:00 2001 From: Anand Chaturvedi Date: Thu, 24 Aug 2017 00:10:17 -0400 Subject: Added New Junit Cases for APPC Design Services Issue-ID: APPC-168 Change-Id: Ib321bb77af3cb47abfce80d96f50a6b75b34b34e Signed-off-by: Anand Chaturvedi --- .../openecomp/appc/instar/node/Dme2ClientTest.java | 0 .../appc/instar/node/TestInstarClientNode.java | 34 ++++++++++++++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/Dme2ClientTest.java (limited to 'appc-outbound/appc-network-inventory-client/provider/src/test/java') diff --git a/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/Dme2ClientTest.java b/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/Dme2ClientTest.java new file mode 100644 index 000000000..e69de29bb diff --git a/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java b/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java index ca88d54db..00e580c39 100644 --- a/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java +++ b/appc-outbound/appc-network-inventory-client/provider/src/test/java/org/openecomp/appc/instar/node/TestInstarClientNode.java @@ -48,6 +48,36 @@ import com.sun.jersey.api.client.filter.HTTPBasicAuthFilter; public class TestInstarClientNode { - - //ONAP Migration + + //ONAP Migration + + @Test(expected=Exception.class) + public void testInstarClientNode() throws Exception { + + SvcLogicContext ctx = new SvcLogicContext(); + String key_conetent = IOUtils.toString(TestInstarClientNode.class.getClassLoader().getResourceAsStream("templates/sampleKeyContents"), Charset.defaultCharset()); + Map inParams = new HashMap(); + inParams.put(InstarClientConstant.INPUT_PARAM_RESPONSE_PRIFIX, "TEST"); + inParams.put(InstarClientConstant.INSTAR_KEYS, "LOCAL_ACCESS_IP_ADDR"); + inParams.put("operationName", InstarClientConstant.OPERATION_GET_IPADDRESS_BY_VNF_NAME); + ctx.setAttribute("INSTAR.LOCAL_ACCESS_IP_ADDR", key_conetent); + ctx.setAttribute(InstarClientConstant.INPUT_PARAM_RESPONSE_PRIFIX, "TEST"); + ctx.setAttribute(InstarClientConstant.VNF_NAME, "basx0003v"); + InstarClientNode icn = new InstarClientNode(); + icn.getInstarInfo(inParams, ctx); + String address = (new JSONObject(ctx.getAttribute("TEST." + InstarClientConstant.INSTAR_KEY_VALUES))).getString("LOCAL_ACCESS_IP_ADDR"); + } + @Test(expected=Exception.class) + public void testInstarData() throws Exception { + + InstarClientNode inNode = new InstarClientNode(); + SvcLogicContext ctx = new SvcLogicContext (); + Map inParams = new HashMap(); + + inParams.put(InstarClientConstant.VNF_NAME, "basx0003v"); + inParams.put("operationName", InstarClientConstant.OPERATION_GET_IPADDRESS_BY_VNF_NAME); + inNode.getInstarData(inParams, ctx); + + + } } -- cgit 1.2.3-korg