aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager
diff options
context:
space:
mode:
authorm.kowalski3 <m.kowalski3@partner.samsung.com>2019-07-04 13:08:24 +0200
committerOren Kleks <orenkle@amdocs.com>2019-07-15 05:33:43 +0000
commit62bf933f27c95db0caab265ffc74b79007236a98 (patch)
treeb08e3ac19749061719d05b25f273f0702d6ffa48 /openecomp-be/backend/openecomp-sdc-vendor-software-product-manager
parent5bb0a3b09bfe2c7f12af05af83223501c29a3f76 (diff)
Add unit tests for NicInternalNetworkErrorBuilder and OnboardingMethodErrorBuilder
Issue-ID: SDC-2327 Signed-off-by: Marcin Kowalski <m.kowalski3@partner.samsung.com> Change-Id: I46e64b3a7a533a20c4e0e5a98aa99c488fa71a6b
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.java42
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilderTest.java41
2 files changed, 83 insertions, 0 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
new file mode 100644
index 0000000000..d8644a5cd6
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilderTest.java
@@ -0,0 +1,42 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class NicInternalNetworkErrorBuilderTest {
+
+ @Test
+ public void testGetNetworkDescriptionInternalNetworkErrorBuilder() {
+ //when
+ ErrorCode errorCode = NicInternalNetworkErrorBuilder.getNetworkDescriptionInternalNetworkErrorBuilder();
+
+ //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());
+ }
+}
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilderTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilderTest.java
new file mode 100644
index 0000000000..edb1a77a67
--- /dev/null
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/OnboardingMethodErrorBuilderTest.java
@@ -0,0 +1,41 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * SDC
+ * ================================================================================
+ * Copyright (C) 2019 Samsung. All rights reserved.
+ * ================================================================================
+ * 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
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.openecomp.sdc.vendorsoftwareproduct.errors;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+
+public class OnboardingMethodErrorBuilderTest {
+
+ @Test
+ public void testGetInvalidOnboardingMethodErrorBuilder() {
+ //when
+ ErrorCode errorCode = OnboardingMethodErrorBuilder.getInvalidOnboardingMethodErrorBuilder();
+
+ //then
+ assertEquals(VendorSoftwareProductErrorCodes.VSP_INVALID_ONBOARDING_METHOD, errorCode.id());
+ assertEquals(ErrorCategory.APPLICATION, errorCode.category());
+ assertEquals("The onboardingMethod value doesn't meet the expected attribute value.", errorCode.message());
+ }
+}