From 30bcbe8f02ea5fec868d0986c0b5185f8af7a5c7 Mon Sep 17 00:00:00 2001 From: ayalaben Date: Tue, 9 Oct 2018 13:12:37 +0300 Subject: Unit test coverage Change-Id: I9d5dc653ed636cb129106ff0ae12b43993611ddf Issue-ID: SDC-1822 Signed-off-by: ayalaben --- ...ationTemplateFileExtensionErrorBuilderTest.java | 26 +++++++++++++++++++++ ...orSoftwareProductCreationFailedBuilderTest.java | 27 ++++++++++++++++++++++ ...dorSoftwareProductNotFoundErrorBuilderTest.java | 27 ++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/OrchestrationTemplateFileExtensionErrorBuilderTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilderTest.java create mode 100644 openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/OrchestrationTemplateFileExtensionErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/OrchestrationTemplateFileExtensionErrorBuilderTest.java new file mode 100644 index 0000000000..1e643fa787 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/OrchestrationTemplateFileExtensionErrorBuilderTest.java @@ -0,0 +1,26 @@ +package org.openecomp.sdc.vendorsoftwareproduct.dao.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.INVALID_EXTENSION; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.testng.Assert; + +public class OrchestrationTemplateFileExtensionErrorBuilderTest { + + private OrchestrationTemplateFileExtensionErrorBuilder orchestrationTemplateFileExtensionErrorBuilder; + + @Before + public void setUp() { + orchestrationTemplateFileExtensionErrorBuilder = new OrchestrationTemplateFileExtensionErrorBuilder(); + } + + @Test + public void shouldReturnInvalidExtentionErrorCode(){ + ErrorCode actual = orchestrationTemplateFileExtensionErrorBuilder.build(); + Assert.assertEquals(actual.category(), ErrorCategory.APPLICATION); + Assert.assertEquals(actual.id(), INVALID_EXTENSION); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilderTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilderTest.java new file mode 100644 index 0000000000..921881d322 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilderTest.java @@ -0,0 +1,27 @@ +package org.openecomp.sdc.vendorsoftwareproduct.dao.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.FAILED_TO_CREATE_VSP; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.testng.Assert; + +public class VendorSoftwareProductCreationFailedBuilderTest { + + private static final String VSP_ID = "testVsp1"; + private VendorSoftwareProductCreationFailedBuilder vendorSoftwareProductCreationFailedBuilder; + + @Before + public void setUp() { + vendorSoftwareProductCreationFailedBuilder = new VendorSoftwareProductCreationFailedBuilder(VSP_ID); + } + + @Test + public void shouldReturnVspNotFoundErrorCode(){ + ErrorCode actual = vendorSoftwareProductCreationFailedBuilder.build(); + Assert.assertEquals(actual.category(), ErrorCategory.APPLICATION); + Assert.assertEquals(actual.id(), FAILED_TO_CREATE_VSP); + } +} diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java new file mode 100644 index 0000000000..75e6b1f6df --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java @@ -0,0 +1,27 @@ +package org.openecomp.sdc.vendorsoftwareproduct.dao.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_NOT_FOUND; + +import org.junit.Before; +import org.junit.Test; +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; +import org.testng.Assert; + +public class VendorSoftwareProductNotFoundErrorBuilderTest { + + private static final String VSP_ID = "testVsp1"; + private VendorSoftwareProductNotFoundErrorBuilder vendorSoftwareProductNotFoundErrorBuilder; + + @Before + public void setUp() { + vendorSoftwareProductNotFoundErrorBuilder = new VendorSoftwareProductNotFoundErrorBuilder(VSP_ID); + } + + @Test + public void shouldReturnVspNotFoundErrorCode(){ + ErrorCode actual = vendorSoftwareProductNotFoundErrorBuilder.build(); + Assert.assertEquals(actual.category(), ErrorCategory.APPLICATION); + Assert.assertEquals(actual.id(), VSP_NOT_FOUND); + } +} -- cgit 1.2.3-korg