summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager
diff options
context:
space:
mode:
authorm.kowalski3 <m.kowalski3@partner.samsung.com>2019-08-07 15:25:14 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2019-08-13 14:13:04 +0000
commitf2b773335f1dd5b71fa83b81c6e788c1c0d10439 (patch)
treebbf7bb5eab23acf746698cd8e1e9ffffbad7908e /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager
parentd3d4e1d4df881ee382ba5ea6eddaeb36c077fc47 (diff)
Add unit tests for NicInternalNetworkErrorBuilder
Issue-ID: SDC-2327 Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com> Change-Id: I8a6127218edf895b8b43d973348cc47794e212c1
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java
index d8644a5cd6..d4d1431a0c 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java
@@ -30,13 +30,39 @@ public class NicInternalNetworkErrorBuilderTest {
@Test
public void testGetNetworkDescriptionInternalNetworkErrorBuilder() {
- //when
+ // when
ErrorCode errorCode = NicInternalNetworkErrorBuilder.getNetworkDescriptionInternalNetworkErrorBuilder();
- //then
+ // then
assertEquals(VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK,
errorCode.id());
assertEquals(ErrorCategory.APPLICATION, errorCode.category());
assertEquals("Invalid request, Network Description not allowed for Internal Networks", errorCode.message());
}
+
+ @Test
+ public void testGetNicNullNetworkIdInternalNetworkIdErrorBuilder() {
+ // when
+ ErrorCode errorCode = NicInternalNetworkErrorBuilder.getNicNullNetworkIdInternalNetworkIdErrorBuilder();
+
+ // then
+ assertEquals(VendorSoftwareProductErrorCodes.NULL_NETWORKID_NOT_ALLOWED, errorCode.id());
+ assertEquals(ErrorCategory.APPLICATION, errorCode.category());
+ assertEquals("Internal Networks are currently not supported for VSP created Manually,"
+ + " so please fix all the NIC to be of Type External and re-submit the VSP.",
+ errorCode.message());
+
+ }
+
+ @Test
+ public void testGetNetworkTypeErrorBuilder() {
+ // when
+ ErrorCode errorCode = NicInternalNetworkErrorBuilder.getNetworkTypeErrorBuilder();
+
+ // then
+ assertEquals(VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED, errorCode.id());
+ assertEquals(ErrorCategory.APPLICATION, errorCode.category());
+ assertEquals("Invalid request, Network Type Update not allowed for a Nic", errorCode.message());
+
+ }
}