diff options
-rw-r--r-- | src/test/java/org/onap/clamp/loop/CsarInstallerItCase.java | 13 |
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); + } } |