From 81f94dffafb4eea8da79b30e89338adc4e338c7d Mon Sep 17 00:00:00 2001 From: talio Date: Mon, 30 Oct 2017 18:06:04 +0200 Subject: duplicate ids change behaviour when recognizing duplicate resource ids in different files Issue - Id : SDC-554 Change-Id: Id1c43fd99caa6a3cc421e894963972d3e76db551 Signed-off-by: talio --- .../UnifiedCompositionMixPatternFullTest.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test') diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java index b1946b3f9b..9399b91ce1 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java @@ -2,7 +2,10 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest; import org.junit.Assert; import org.junit.Before; +import org.junit.Rule; import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest; @@ -19,6 +22,9 @@ public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTes // do not delete this function. it prevents the superclass setup from running } + @Rule + public ExpectedException exception = ExpectedException.none(); + @Test public void testMixPatterns() throws IOException { inputFilesPath = @@ -52,16 +58,13 @@ public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTes @Test public void testDuplicateResourceIdsInDiffAddOnFiles() throws IOException { + exception.expect(CoreException.class); + exception.expectMessage("Resource with id lb_0_int_oam_int_0_port occurs more " + + "than once in different addOn files"); + inputFilesPath = "/mock/services/heattotosca/fulltest/mixPatterns/duplicateResourceIdsInDiffAddOnFiles/in"; - - try { - testTranslationWithInit(); - }catch(Exception e){ - log.debug("",e); - Assert.assertEquals(e.getMessage(), "Resource with id lb_0_int_oam_int_0_port occures more " + - "than once in different addOn files"); - } + testTranslationWithInit(); } @Test -- cgit