diff options
author | 2017-04-11 13:30:42 +0200 | |
---|---|---|
committer | 2017-04-11 15:34:19 +0200 | |
commit | b6b7bef8bdcad15af01ac88a038dd763ce59f68f (patch) | |
tree | 399d39da23aaa37701e487df064e3e0c27709ef3 /asdc-controller/src/test/java/org/openecomp/mso/asdc/client | |
parent | 19340cad94eeaa1b580f7c0c99531de499e8ca14 (diff) |
[MSO-8] Update the maven dependency
Update the maven depenency for sdc-distribution-client to cooperate with the sdc changes.
Change-Id: I2da936e5c40cb68c7181bb78307192dd5655b5dc
Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'asdc-controller/src/test/java/org/openecomp/mso/asdc/client')
-rw-r--r-- | asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCElementInfoTest.java | 81 |
1 files changed, 40 insertions, 41 deletions
diff --git a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCElementInfoTest.java b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCElementInfoTest.java index 23b7a80dbe..63da38d8c1 100644 --- a/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCElementInfoTest.java +++ b/asdc-controller/src/test/java/org/openecomp/mso/asdc/client/tests/ASDCElementInfoTest.java @@ -7,9 +7,9 @@ * 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. @@ -33,7 +33,6 @@ import java.util.UUID; import org.junit.Test; import org.mockito.Mockito; - import org.openecomp.sdc.api.notification.IArtifactInfo; import org.openecomp.sdc.api.notification.INotificationData; import org.openecomp.sdc.api.notification.IResourceInstance; @@ -43,20 +42,20 @@ import org.openecomp.mso.asdc.client.exceptions.ArtifactInstallerException; import org.openecomp.mso.asdc.installer.ASDCElementInfo; import org.openecomp.mso.asdc.installer.VfModuleStructure; import org.openecomp.mso.asdc.installer.VfResourceStructure; - +import org.openecomp.mso.asdc.installer.IVfModuleData; public class ASDCElementInfoTest { - + @Test public void createASDCElementInfoWithNullParameterTest() { ASDCElementInfo elementInfoFromNullVfArtifact = ASDCElementInfo.createElementFromVfArtifactInfo(null); ASDCElementInfo elementInfoFromNullVfModuleStructure = ASDCElementInfo.createElementFromVfModuleStructure(null); ASDCElementInfo elementInfoFromNullVfResourceStructure = ASDCElementInfo.createElementFromVfResourceStructure(null); - + elementInfoFromNullVfArtifact.addElementInfo(null, null); elementInfoFromNullVfModuleStructure.addElementInfo(null, "someValue"); elementInfoFromNullVfResourceStructure.addElementInfo("someKey", null); - + assertEquals(elementInfoFromNullVfArtifact.toString(), ""); assertEquals(elementInfoFromNullVfModuleStructure.toString(), ""); assertEquals(elementInfoFromNullVfResourceStructure.toString(), ""); @@ -66,107 +65,107 @@ public class ASDCElementInfoTest { assertNotNull(elementInfoFromNullVfResourceStructure); assertNotNull(ASDCElementInfo.EMPTY_INSTANCE); - + assertEquals(elementInfoFromNullVfArtifact, ASDCElementInfo.EMPTY_INSTANCE); assertEquals(elementInfoFromNullVfModuleStructure, ASDCElementInfo.EMPTY_INSTANCE); assertEquals(elementInfoFromNullVfResourceStructure, ASDCElementInfo.EMPTY_INSTANCE); - + assertEquals(ASDCElementInfo.EMPTY_INSTANCE.getType(), ""); assertEquals(ASDCElementInfo.EMPTY_INSTANCE.toString(), ""); - + assertEquals(elementInfoFromNullVfArtifact.getType(), ASDCElementInfo.EMPTY_INSTANCE.getType()); assertEquals(elementInfoFromNullVfModuleStructure.getType(), ASDCElementInfo.EMPTY_INSTANCE.getType()); assertEquals(elementInfoFromNullVfResourceStructure.getType(), ASDCElementInfo.EMPTY_INSTANCE.getType()); } - + @Test public void createASDCElementInfoFromVfResourceTest() { - + String resourceInstanceName = "Resource 1"; - + UUID generatedUUID = UUID.randomUUID(); - + INotificationData notificationData = Mockito.mock(INotificationData.class); IResourceInstance resourceInstance = Mockito.mock(IResourceInstance.class); - + Mockito.when(resourceInstance.getResourceInstanceName()).thenReturn(resourceInstanceName); Mockito.when(resourceInstance.getResourceInvariantUUID()).thenReturn(generatedUUID.toString()); - + VfResourceStructure vfResourceStructure = new VfResourceStructure(notificationData, resourceInstance); - + ASDCElementInfo elementInfoFromVfResource = ASDCElementInfo.createElementFromVfResourceStructure(vfResourceStructure); - + assertTrue(elementInfoFromVfResource.toString().contains(resourceInstanceName)); assertTrue(elementInfoFromVfResource.toString().contains(generatedUUID.toString())); - + assertFalse(ASDCConfiguration.VF_MODULES_METADATA.equals(elementInfoFromVfResource.getType())); assertEquals(ASDCElementInfo.ASDCElementTypeEnum.VNF_RESOURCE.name(), elementInfoFromVfResource.getType()); - + assertFalse(elementInfoFromVfResource.toString().contains("MyInfo1: someValue")); elementInfoFromVfResource.addElementInfo("MyInfo1", "someValue"); assertTrue(elementInfoFromVfResource.toString().contains("MyInfo1: someValue")); } - + @Test public void createASDCElementInfoFromVfModuleTest() throws ArtifactInstallerException { - + String resourceInstanceName = "Resource 1"; - + UUID generatedUUID = UUID.randomUUID(); - + INotificationData notificationData = Mockito.mock(INotificationData.class); IResourceInstance resourceInstance = Mockito.mock(IResourceInstance.class); - + Mockito.when(resourceInstance.getResourceInstanceName()).thenReturn(resourceInstanceName); Mockito.when(resourceInstance.getResourceInvariantUUID()).thenReturn(generatedUUID.toString()); - + VfResourceStructure vfResourceStructure = new VfResourceStructure(notificationData, resourceInstance); - + // Create module structure now - + String vfModuleModelName = "Module Model XYZ"; - + UUID generatedUUIDForModule = UUID.randomUUID(); - - IVfModuleMetadata moduleMetadata = Mockito.mock(IVfModuleMetadata.class); + + IVfModuleData moduleMetadata = Mockito.mock(IVfModuleData.class); Mockito.when(moduleMetadata.getVfModuleModelName()).thenReturn(vfModuleModelName); Mockito.when(moduleMetadata.getVfModuleModelInvariantUUID()).thenReturn(generatedUUIDForModule.toString()); Mockito.when(moduleMetadata.getArtifacts()).thenReturn(Collections.<String> emptyList()); - + VfModuleStructure vfModuleStructure = new VfModuleStructure(vfResourceStructure, moduleMetadata); - + ASDCElementInfo elementInfoFromVfModule = ASDCElementInfo.createElementFromVfModuleStructure(vfModuleStructure); - + assertTrue(elementInfoFromVfModule.toString().contains(vfModuleModelName)); assertTrue(elementInfoFromVfModule.toString().contains(generatedUUIDForModule.toString())); - + assertFalse(ASDCElementInfo.ASDCElementTypeEnum.VNF_RESOURCE.name().equals(elementInfoFromVfModule.getType())); assertEquals(ASDCConfiguration.VF_MODULES_METADATA, elementInfoFromVfModule.getType()); - + assertFalse(elementInfoFromVfModule.toString().contains("MyInfo2: someValue")); elementInfoFromVfModule.addElementInfo("MyInfo2", "someValue"); assertTrue(elementInfoFromVfModule.toString().contains("MyInfo2: someValue")); } - + @Test public void createASDCElementInfoFromArtifact() { for (String eVal : ASDCConfiguration.SUPPORTED_ARTIFACT_TYPES_LIST) { String generatedArtifactName = eVal + " 1"; UUID generatedUUIDForArtifact = UUID.randomUUID(); - + IArtifactInfo artifactInfo = Mockito.mock(IArtifactInfo.class); Mockito.when(artifactInfo.getArtifactType()).thenReturn(eVal); Mockito.when(artifactInfo.getArtifactName()).thenReturn(generatedArtifactName); Mockito.when(artifactInfo.getArtifactUUID()).thenReturn(generatedUUIDForArtifact.toString()); - + ASDCElementInfo elementInfoFromArtifact = ASDCElementInfo.createElementFromVfArtifactInfo(artifactInfo); assertTrue(elementInfoFromArtifact.toString().contains(generatedArtifactName)); assertTrue(elementInfoFromArtifact.toString().contains(generatedUUIDForArtifact.toString())); - + assertFalse(ASDCElementInfo.ASDCElementTypeEnum.VNF_RESOURCE.name().equals(elementInfoFromArtifact.getType())); assertEquals(eVal, elementInfoFromArtifact.getType()); - + assertFalse(elementInfoFromArtifact.toString().contains("MyInfo3: someValue")); elementInfoFromArtifact.addElementInfo("MyInfo3", "someValue"); assertTrue(elementInfoFromArtifact.toString().contains("MyInfo3: someValue")); |