diff options
author | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2018-03-16 19:44:41 +0100 |
---|---|---|
committer | Determe, Sebastien (sd378r) <sd378r@intl.att.com> | 2018-03-16 19:44:41 +0100 |
commit | 23f4383ad441f5afa363941d2aab980f64dbf7f3 (patch) | |
tree | 5b29968a95ee1264150cb9a4a8707fb14e6a3eef /src/test/java | |
parent | 2ff12cf396e3ea6ab166e8c9bc7fc1cab93e8cd5 (diff) |
CsarHandler rework
Reworking of the csarHandler to support cache of dcae blueprint
Issue-ID: CLAMP-81
Change-Id: Ic9c71d8f23ac75a6273781991f5ac7a60c4f328d
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java index d1b177d22..34805d87a 100644 --- a/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java +++ b/src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java @@ -38,7 +38,6 @@ import java.nio.file.Paths; import java.util.ArrayList; import java.util.List; -import org.junit.AfterClass; import org.junit.Test; import org.mockito.Mockito; import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; @@ -54,13 +53,6 @@ public class CsarHandlerTest { private static final String sdcFolder = "/tmp/csar-handler-tests"; private static final String csarArtifactName = "testArtifact.csar"; - @AfterClass - public static void removeAllFiles() throws IOException { - // Do some cleanup - Path path = Paths.get(sdcFolder + "/test-controller/" + csarArtifactName); - Files.deleteIfExists(path); - } - @Test public void testConstructor() throws CsarHandlerException { IArtifactInfo serviceArtifact = Mockito.mock(IArtifactInfo.class); @@ -96,9 +88,18 @@ public class CsarHandlerTest { IDistributionClientDownloadResult resultArtifact = Mockito.mock(IDistributionClientDownloadResult.class); Mockito.when(resultArtifact.getArtifactPayload()).thenReturn( IOUtils.toByteArray(ResourceFileUtil.getResourceAsStream("example/sdc/service-Simsfoimap0112.csar"))); + // Test the save csar.save(resultArtifact); assertTrue((new File(sdcFolder + "/test-controller/" + csarArtifactName)).exists()); assertEquals(csarArtifactName, csar.getArtifactElement().getArtifactName()); assertNotNull(csar.getSdcCsarHelper()); + // Test dcaeBlueprint + String blueprint = csar.getDcaeBlueprint(); + assertNotNull(blueprint); + assertTrue(!blueprint.isEmpty()); + assertTrue(blueprint.contains("DCAE-VES-PM-EVENT-v1")); + // Do some cleanup + Path path = Paths.get(sdcFolder + "/test-controller/" + csarArtifactName); + Files.deleteIfExists(path); } } |