diff options
author | 2020-01-16 15:13:14 -0500 | |
---|---|---|
committer | 2020-01-29 19:44:48 +0000 | |
commit | b5fe8a69e90b950c07dc11af481eab7e9bab52c6 (patch) | |
tree | 3da81ce60554e65b93776b9aea647f3c6d8679ab /appc-dg/appc-dg-shared/appc-dg-aai/src/test/java | |
parent | 9b32cb60360a2a2973c621053510718de0072111 (diff) |
Change code in appc dispatcher for new LCMs in R6
Also introduce some minor improvements to robustness, efficiency, & formatting.
Issue-ID: APPC-1789
Signed-off-by: Dunietz, Irwin <id1681@att.com>
Change-Id: I82d970c2f7cde6c8dab1222af86ea70ce93b7e50
Diffstat (limited to 'appc-dg/appc-dg-shared/appc-dg-aai/src/test/java')
2 files changed, 31 insertions, 25 deletions
diff --git a/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/AAIPluginImplTest.java b/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/AAIPluginImplTest.java index d89bd4730..12dde3141 100644 --- a/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/AAIPluginImplTest.java +++ b/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/AAIPluginImplTest.java @@ -3,6 +3,8 @@ * ONAP : APPC * ================================================================================ * Copyright (C) 2018 Ericsson + * ================================================================================ + * Modifications Copyright (C) 2019 AT&T Intellectual Property * ============================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,8 +113,8 @@ public class AAIPluginImplTest { AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); impl.postGenericVnfData(params, ctx); - Assert.assertThat(ctx.getAttribute(org.onap.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE), CoreMatchers.containsString( - "Operation PostGenericVnfData succeed for VNF ID null")); + Assert.assertThat(ctx.getAttribute(org.onap.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE), + CoreMatchers.containsString("Operation PostGenericVnfData succeed for VNF ID null")); } @Test @@ -162,14 +164,15 @@ public class AAIPluginImplTest { AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); impl.getGenericVnfData(params, ctx); - Assert.assertThat(ctx.getAttribute(org.onap.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE), CoreMatchers.containsString( - "Operation GetGenericVnfData succeed for VNF ID null")); + Assert.assertThat(ctx.getAttribute(org.onap.appc.Constants.ATTRIBUTE_SUCCESS_MESSAGE), + CoreMatchers.containsString("Operation GetGenericVnfData succeed for VNF ID null")); } @Test public void testGetGenericVnfDataFailureThrownExeption() throws APPCException, SvcLogicException { - Mockito.doThrow(new SvcLogicException()).when(aaiClient).query(Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyString(), - Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.any(SvcLogicContext.class)); + Mockito.doThrow(new SvcLogicException()).when(aaiClient).query(Mockito.anyString(), Mockito.anyBoolean(), + Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), + Mockito.any(SvcLogicContext.class)); ctx = new SvcLogicContext(); AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); @@ -194,8 +197,9 @@ public class AAIPluginImplTest { @Test public void testGetVnfHierarchyAaiExceptionFlow2() throws APPCException, SvcLogicException { - Mockito.doThrow(new SvcLogicException()).when(aaiClient).query(Mockito.anyString(), Mockito.anyBoolean(), Mockito.anyString(), - Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.any(SvcLogicContext.class)); + Mockito.doThrow(new SvcLogicException()).when(aaiClient).query(Mockito.anyString(), Mockito.anyBoolean(), + Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), + Mockito.any(SvcLogicContext.class)); ctx = new SvcLogicContext(); params.put(Constants.RESOURCEKEY, "TEST_RESOURCE_KEY"); AAIPluginImpl impl = new AAIPluginImpl(); @@ -268,7 +272,7 @@ public class AAIPluginImplTest { AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); impl.getResource(params, ctx); - Assert.assertEquals("SUCCESS",ctx.getAttribute("getResource_result")); + Assert.assertEquals("SUCCESS", ctx.getAttribute("getResource_result")); } @Test @@ -281,7 +285,7 @@ public class AAIPluginImplTest { AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); impl.postResource(params, ctx); - Assert.assertEquals("SUCCESS",ctx.getAttribute("postResource_result")); + Assert.assertEquals("SUCCESS", ctx.getAttribute("postResource_result")); } @Test @@ -294,6 +298,6 @@ public class AAIPluginImplTest { AAIPluginImpl impl = new AAIPluginImpl(); impl.initialize(); impl.deleteResource(params, ctx); - Assert.assertEquals("SUCCESS",ctx.getAttribute("deleteResource_result")); + Assert.assertEquals("SUCCESS", ctx.getAttribute("deleteResource_result")); } } diff --git a/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/TestConstants.java b/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/TestConstants.java index ec562f0a0..1d269a985 100644 --- a/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/TestConstants.java +++ b/appc-dg/appc-dg-shared/appc-dg-aai/src/test/java/org/onap/appc/dg/aai/impl/TestConstants.java @@ -5,6 +5,8 @@ * Copyright 2018 TechMahindra * ================================================================================ * Modifications Copyright (C) 2019 Ericsson +* ================================================================================ +* Modifications Copyright (C) 2019 AT&T Intellectual Property *================================================================================= * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,21 +29,21 @@ import org.junit.Test; import org.onap.appc.dg.aai.impl.Constants.SDC_ARTIFACTS_FIELDS; public class TestConstants { - private SDC_ARTIFACTS_FIELDS c=SDC_ARTIFACTS_FIELDS.SERVICE_NAME; + private SDC_ARTIFACTS_FIELDS c = SDC_ARTIFACTS_FIELDS.SERVICE_NAME; - @Test - public void testConstants() { - Assert.assertEquals("sdnctl",Constants.NETCONF_SCHEMA); - } + @Test + public void testConstants() { + Assert.assertEquals("sdnctl", Constants.NETCONF_SCHEMA); + } - @Test - public void testName() { - Assert.assertEquals("SERVICE_NAME",c.name()); - } + @Test + public void testName() { + Assert.assertEquals("SERVICE_NAME", c.name()); + } - @Test - public void testEqual() { - Assert.assertTrue(c.equals(SDC_ARTIFACTS_FIELDS.SERVICE_NAME)); - Assert.assertFalse(c.equals(null)); - } + @Test + public void testEqual() { + Assert.assertTrue(c.equals(SDC_ARTIFACTS_FIELDS.SERVICE_NAME)); + Assert.assertFalse(c.equals(null)); + } } |