diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/org/onap/clamp/clds/it/CldsTemplateServiceItCase.java | 9 | ||||
-rw-r--r-- | src/test/java/org/onap/clamp/clds/sdc/controller/installer/CsarHandlerTest.java | 17 |
2 files changed, 10 insertions, 16 deletions
diff --git a/src/test/java/org/onap/clamp/clds/it/CldsTemplateServiceItCase.java b/src/test/java/org/onap/clamp/clds/it/CldsTemplateServiceItCase.java index 1caa637c5..be2997a31 100644 --- a/src/test/java/org/onap/clamp/clds/it/CldsTemplateServiceItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/CldsTemplateServiceItCase.java @@ -35,7 +35,6 @@ import java.security.Principal; import java.util.List; import javax.ws.rs.core.SecurityContext; -import javax.xml.transform.TransformerException; import org.junit.Before; import org.junit.Test; @@ -93,13 +92,7 @@ public class CldsTemplateServiceItCase { cldsTemplate.setBpmnText(bpmnText); cldsTemplate.setImageText(imageText); cldsTemplate.setPropText(bpmnPropText); - try { - cldsTemplateService.putTemplate("testModel", cldsTemplate); - } catch (IOException e) { - logger.error("IOException while saving template", e); - } catch (TransformerException ex) { - logger.error("Transforming exception while saving template.", ex); - } + cldsTemplateService.putTemplate("testModel", cldsTemplate); } @Test 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); } } |