aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorAdam Krysiak <adam.krysiak@nokia.com>2019-06-04 07:12:24 +0000
committerGerrit Code Review <gerrit@onap.org>2019-06-04 07:12:24 +0000
commitcf5931fe32003961af254cfa69120930a713fcca (patch)
treecb095e880da8ccfa9c4649cdfe4f6e6fe5c3cac4 /src/test
parent657f27d2e2b2bfeeb9c91e58219e88938bc912e3 (diff)
parentc280526ad7a69a84dc3970665eb08d3d7d2c87a9 (diff)
Merge "Improve test coverage Improve test coverage in CsarInstallerImpl"
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 cd6db68db..ed912831e 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;
@@ -63,7 +65,6 @@ import org.skyscreamer.jsonassert.JSONAssert;
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;
@@ -220,4 +221,12 @@ public class CsarInstallerItCase {
assertThat(((MicroServicePolicy) (loop.getMicroServicePolicies().toArray()[0])).getModelType()).isNotEmpty();
}
+ @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);
+ }
}