diff options
Diffstat (limited to 'ms/neng')
5 files changed, 151 insertions, 2 deletions
diff --git a/ms/neng/pom.xml b/ms/neng/pom.xml index 610d7ed6..3f90e0af 100644 --- a/ms/neng/pom.xml +++ b/ms/neng/pom.xml @@ -115,7 +115,7 @@ </profile> <profile> - <id>docker</id> + <id>dockerTBD</id> <build> <plugins> <plugin> @@ -134,7 +134,7 @@ </executions> <configuration> <imageName>${docker.registry}/onap/ccsdk-apps-ms-neng:${project.version}</imageName> - <dockerDirectory>src/main/docker</dockerDirectory> + <dockerDirectory>${basedir}/target/docker</dockerDirectory> <serverId>docker-hub</serverId> <registryUrl>https://${docker.registry}</registryUrl> <imageTags> @@ -552,6 +552,14 @@ </plugins> <resources> <resource> + <directory>src/main/docker</directory> + <targetPath>../docker</targetPath> + <filtering>true</filtering> + <includes> + <include>**/*</include> + </includes> + </resource> + <resource> <directory>src/main/resources</directory> <filtering>true</filtering> <includes> diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyPropertyMethodUtilsTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyPropertyMethodUtilsTest.java index f527b38b..f54e680e 100644 --- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyPropertyMethodUtilsTest.java +++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/policy/PolicyPropertyMethodUtilsTest.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2018 AT&T Intellectual Property. All rights 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. * You may obtain a copy of the License at @@ -21,6 +23,7 @@ package org.onap.ccsdk.apps.ms.neng.core.policy; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import org.junit.Test; @@ -34,5 +37,7 @@ public class PolicyPropertyMethodUtilsTest { assertEquals("TRLAKDG", PolicyPropertyMethodUtils.substring("TRLAKDG", "-11")); assertEquals("XYSZ1NNN", PolicyPropertyMethodUtils.toUpperCase("XySz1NNN")); assertEquals("xysz1nnn", PolicyPropertyMethodUtils.toLowerCase("XySz1NNN")); + assertTrue(PolicyPropertyMethodUtils.genUuid() instanceof String); + assertTrue(PolicyPropertyMethodUtils.getIsoDateString() instanceof String); } } diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/AaiResponseTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/AaiResponseTest.java new file mode 100644 index 00000000..81279b9d --- /dev/null +++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/resource/model/AaiResponseTest.java @@ -0,0 +1,41 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : CCSDK.apps + * ================================================================================ + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.ccsdk.apps.ms.neng.core.resource.model; + +import static org.junit.Assert.assertEquals; +import org.junit.Before; +import org.junit.Test; + +public class AaiResponseTest { + private AaiResponse aai; + + @Before + public void setup() { + aai = new AaiResponse(); + } + + @Test + public void isRecFound() { + aai.setRecFound(true); + assertEquals(true, aai.isRecFound()); + } + +} diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java index 7ea63e61..22063a4d 100644 --- a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java +++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/core/service/SpringServiceTest.java @@ -109,6 +109,11 @@ public class SpringServiceTest { Assert.assertNotNull(springserviceImpl.releaseNetworkElementName(request)); } + @Test(expected=Exception.class) + public void releaseNetworkElementNameTestForNull() throws Exception { + springserviceImpl.releaseNetworkElementName(null); + } + @Test public void testGetQuickHello() { Assert.assertTrue(springserviceImpl.getQuickHello("testMessage") instanceof HelloWorld); diff --git a/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/persistence/entity/GeneratedNameTest.java b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/persistence/entity/GeneratedNameTest.java new file mode 100644 index 00000000..7965b7a4 --- /dev/null +++ b/ms/neng/src/test/java/org/onap/ccsdk/apps/ms/neng/persistence/entity/GeneratedNameTest.java @@ -0,0 +1,90 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP : CCSDK.apps + * ================================================================================ + * 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.onap.ccsdk.apps.ms.neng.persistence.entity; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class GeneratedNameTest { + private GeneratedName generatedName; + + @Before + public void setUp() { + generatedName = new GeneratedName(); + } + + @Test + public void testGetSetGeneratedNameId() { + generatedName.setGeneratedNameId(1); + Integer expected = 1; + Assert.assertEquals(expected, generatedName.getGeneratedNameId()); + } + + @Test + public void testGetSetSequenceNumber() { + generatedName.setSequenceNumber(2121314312321L); + Long expected = 2121314312321L; + Assert.assertEquals(expected, generatedName.getSequenceNumber()); + } + + @Test + public void testGetSetSequenceNumberEnc() { + generatedName.setSequenceNumberEnc("TestSequenceNumberEnc"); + String expected = "TestSequenceNumberEnc"; + Assert.assertEquals(expected, generatedName.getSequenceNumberEnc()); + } + + @Test + public void testGetSetElementType() { + generatedName.setElementType("TestElementType"); + String expected = "TestElementType"; + Assert.assertEquals(expected, generatedName.getElementType()); + } + + @Test + public void testGetSetName() { + generatedName.setName("TestName"); + String expected = "TestName"; + Assert.assertEquals(expected, generatedName.getName()); + } + + @Test + public void testGetSetPrefix() { + generatedName.setPrefix("TestPrefix"); + String expected = "TestPrefix"; + Assert.assertEquals(expected, generatedName.getPrefix()); + } + + @Test + public void testGetSetSuffix() { + generatedName.setSuffix("TestSuffix"); + String expected = "TestSuffix"; + Assert.assertEquals(expected, generatedName.getSuffix()); + } + + @Test + public void testGetSetIsReleased() { + generatedName.setIsReleased("TestIsReleased"); + String expected = "TestIsReleased"; + Assert.assertEquals(expected, generatedName.getIsReleased()); + } + +} |