From 350b41105138242190f0dd42396721a0195e04d2 Mon Sep 17 00:00:00 2001 From: "Determe, Sebastien (sd378r)" Date: Wed, 21 Mar 2018 18:27:38 +0100 Subject: Rework of the csarinstaller Csarinstaller rework to save Template and Model to database Issue-ID: CLAMP-81 Change-Id: I5edf9716146975ed3751a93b78f5c9b0b9ff2af9 Signed-off-by: Determe, Sebastien (sd378r) --- .../clds/it/sdc/controller/installer/CsarInstallerItCase.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/test/java') diff --git a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java index 94adfafa8..6ae64ef7d 100644 --- a/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java +++ b/src/test/java/org/onap/clamp/clds/it/sdc/controller/installer/CsarInstallerItCase.java @@ -38,6 +38,7 @@ import org.mockito.Mockito; import org.onap.clamp.clds.dao.CldsDao; import org.onap.clamp.clds.exception.sdc.controller.CsarHandlerException; import org.onap.clamp.clds.exception.sdc.controller.SdcArtifactInstallerException; +import org.onap.clamp.clds.model.CldsModel; import org.onap.clamp.clds.model.CldsTemplate; import org.onap.clamp.clds.sdc.controller.installer.CsarHandler; import org.onap.clamp.clds.sdc.controller.installer.CsarInstaller; @@ -90,7 +91,7 @@ public class CsarInstallerItCase { Mockito.when(csarHelper.getServiceMetadata()).thenReturn(data); Mockito.when(csarHandler.getSdcCsarHelper()).thenReturn(csarHelper); csarInstaller.installTheCsar(csarHandler); - // Get it back from DB + // Get the template back from DB CldsTemplate templateFromDB = CldsTemplate.retrieve(cldsDao, generatedName + CsarInstallerImpl.TEMPLATE_NAME_SUFFIX, false); assertNotNull(templateFromDB); @@ -98,5 +99,12 @@ public class CsarInstallerItCase { assertNotNull(templateFromDB.getImageText()); assertNotNull(templateFromDB.getPropText()); assertEquals(templateFromDB.getName(), generatedName + CsarInstallerImpl.TEMPLATE_NAME_SUFFIX); + // Get the Model back from DB + CldsModel modelFromDB = CldsModel.retrieve(cldsDao, generatedName + CsarInstallerImpl.MODEL_NAME_SUFFIX, false); + assertNotNull(modelFromDB); + assertNotNull(modelFromDB.getBpmnText()); + assertNotNull(modelFromDB.getImageText()); + assertNotNull(modelFromDB.getPropText()); + assertEquals(modelFromDB.getName(), generatedName + CsarInstallerImpl.MODEL_NAME_SUFFIX); } } -- cgit 1.2.3-korg