aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2018-10-04 11:55:10 +0530
committerOren Kleks <orenkle@amdocs.com>2018-10-09 06:44:01 +0000
commit55d9a168af4f87d3cd827fb975b6ed73e334cb55 (patch)
treef2c8a546b7934314269e82e27af75eab0fad7710 /openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java
parent11c2543fbc1f52ab5d3019d3ee0cb4ea7bc6f97d (diff)
Increased UT coverage-openecomp-sdc-versioning-api
Increased UT coverage openecomp-sdc-versioning-api Change-Id: I0e16ae376805359b7d4c2db72ce83c5c07d7ec9e Issue-ID: SDC-1673 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java')
-rw-r--r--openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java
new file mode 100644
index 0000000000..d269204fba
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilderTest.java
@@ -0,0 +1,34 @@
+package org.openecomp.sdc.versioning.errors;
+
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openecomp.sdc.common.errors.ErrorCategory;
+import org.openecomp.sdc.common.errors.ErrorCode;
+import org.openecomp.sdc.versioning.dao.types.Version;
+
+import java.util.Arrays;
+
+public class VersionableSubEntityNotFoundErrorBuilderTest {
+ @Test
+ public void test() {
+ VersionableSubEntityNotFoundErrorBuilder builder = new VersionableSubEntityNotFoundErrorBuilder("entityType",
+ "entityId", "containingEntityType", "ContainingEntityId", new Version("0.0"));
+ ErrorCode build = builder.build();
+ Assert.assertEquals(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND, build.id());
+ Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+ Assert.assertEquals(String.format(VersionableSubEntityNotFoundErrorBuilder.SUB_ENTITY_NOT_FOUND_MSG,
+ "entityType", "entityId", "containingEntityType", "ContainingEntityId", "0.0"), build.message());
+ }
+
+ @Test
+ public void testWithListOfIds() {
+ VersionableSubEntityNotFoundErrorBuilder builder = new VersionableSubEntityNotFoundErrorBuilder("entityType",
+ Arrays.asList("entityId"), "containingEntityType", "ContainingEntityId", new Version("0.0"));
+ ErrorCode build = builder.build();
+ Assert.assertEquals(VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND, build.id());
+ Assert.assertEquals(ErrorCategory.APPLICATION, build.category() );
+ Assert.assertEquals(String.format(VersionableSubEntityNotFoundErrorBuilder.SUB_ENTITIES_NOT_FOUND_MSG,
+ "entityType", "entityId", "containingEntityType", "ContainingEntityId", "0.0"), build.message());
+ }
+} \ No newline at end of file