summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorm.kowalski3 <m.kowalski3@partner.samsung.com>2019-04-24 14:58:44 +0200
committerm.kowalski3 <m.kowalski3@partner.samsung.com>2019-05-17 08:29:32 +0200
commitc280526ad7a69a84dc3970665eb08d3d7d2c87a9 (patch)
tree2791085b602f645f4ee0b9f1260d9d6ae1ea37f4 /src/test
parent9507b7416ee595eb59e25c6797f3720c0a89767c (diff)
Improve test coverage
Improve test coverage in CsarInstallerImpl Change-Id: I5c514e8c58be3125c3921ce1d80a9507f7f50838 Issue-ID: CLAMP-348 Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com>
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
index 883945eb..26e8de20 100644
--- a/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
+++ b/src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java
@@ -6,7 +6,8 @@
* reserved.
* ================================================================================
* Modifications copyright (c) 2019 Nokia
- * ===================================================================
+ * Modifications Copyright (c) 2019 Samsung
+ * ================================================================================
* 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
@@ -26,6 +27,7 @@
package org.onap.clamp.loop;
import static org.assertj.core.api.Assertions.assertThat;
+import static org.mockito.Matchers.any;
import java.io.IOException;
import java.util.ArrayList;
@@ -60,7 +62,6 @@ import org.onap.sdc.toscaparser.api.elements.Metadata;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.annotation.Rollback;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
@@ -204,4 +205,12 @@ public class CsarInstallerItCase {
assertThat(loop.getModelPropertiesJson().get("resourceDetails")).isNotNull();
}
+ @Test(expected = SdcArtifactInstallerException.class)
+ @Transactional
+ public void shouldThrowSdcArtifactInstallerException() throws SdcArtifactInstallerException, SdcToscaParserException, IOException, InterruptedException, PolicyModelException {
+ String generatedName = RandomStringUtils.randomAlphanumeric(5);
+ CsarHandler csarHandler = buildFakeCsarHandler(generatedName);
+ Mockito.when(csarHandler.getMapOfBlueprints()).thenThrow(IOException.class);
+ csarInstaller.installTheCsar(csarHandler);
+ }
}