diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test')
2 files changed, 36 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilderTests.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilderTests.java index 2e471a15e8..b5dfae1ce6 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilderTests.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/ComponentDependencyModelErrorBuilderTests.java @@ -31,7 +31,7 @@ public class ComponentDependencyModelErrorBuilderTests { @Test public void testGetCyclicDependencyComponentErrorBuilder() { //when - ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getcyclicDependencyComponentErrorBuilder(); + ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getCyclicDependencyComponentErrorBuilder(); //then assertEquals("CYCLIC_DEPENDENCY_IN_COMPONENTS", errorCode.id()); @@ -49,4 +49,26 @@ public class ComponentDependencyModelErrorBuilderTests { assertEquals(ErrorCategory.APPLICATION, errorCode.category()); assertEquals("Invalid relation type for components.", errorCode.message()); } + + @Test + public void testGetNoSourceComponentErrorBuilder() { + //when + ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder(); + + //then + assertEquals("NO_SOURCE_COMPONENT", errorCode.id()); + assertEquals(ErrorCategory.APPLICATION, errorCode.category()); + assertEquals("Source component is mandatory.", errorCode.message()); + } + + @Test + public void testGetSourceTargetComponentEqualErrorBuilder() { + //when + ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getSourceTargetComponentEqualErrorBuilder(); + + //then + assertEquals("SAME_SOURCE_TARGET_COMPONENT", errorCode.id()); + assertEquals(ErrorCategory.APPLICATION, errorCode.category()); + assertEquals("Source and target components are same.", errorCode.message()); + } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilderTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilderTest.java index 2f833ef444..4050ffd4a1 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilderTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/DuplicateComputeInComponentErrorBuilderTest.java @@ -39,4 +39,17 @@ public class DuplicateComputeInComponentErrorBuilderTest { assertEquals("Update of attribute not allowed for VSP onboarded via HEAT.", errorCode.message()); } + + @Test + public void testBuild() { + // given + DuplicateComputeInComponentErrorBuilder duplicateComputeInComponentErrorBuilder = + new DuplicateComputeInComponentErrorBuilder(); + + // when + ErrorCode errorCode = duplicateComputeInComponentErrorBuilder.build(); + + // then + assertEquals(ErrorCategory.APPLICATION, errorCode.category()); + } } |