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>
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java
index f0d8051..b46deea 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class CheckinOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
 
-  private static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+   static final String CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
       "Can not check in versionable entity %s with id %s since it is checked out by other "
           + "user: %s.";
 
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java
index 4628feb..1ed8476 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class CheckinOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
 
-  private static final String CHECKIN_ON_UNLOCKED_ENTITY_MSG =
+   static final String CHECKIN_ON_UNLOCKED_ENTITY_MSG =
       "Can not check in versionable entity %s with id %s since it is not checked out.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java
index 9784782..c56b08f 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class CheckoutOnLockedEntityErrorBuilder extends BaseErrorBuilder {
 
-  private static final String CHECKOT_ON_LOCKED_ENTITY_MSG =
+   static final String CHECKOT_ON_LOCKED_ENTITY_MSG =
       "Can not check out versionable entity %s with id %s since it is checked out by "
           + "other user: %s.";
 
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java
index a431e92..da181ce 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class DeleteOnLockedEntityErrorBuilder extends BaseErrorBuilder {
 
-  private static final String DELETE_ON_LOCKED_ENTITY_MSG =
+   static final String DELETE_ON_LOCKED_ENTITY_MSG =
       "Can not delete versionable entity %s with id %s since it is checked out by other user: %s.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java
index 2c41bde..bfebfd2 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class EditOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
 
-  private static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+   static final String EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
       "Versionable entity %s with id %s can not be edited since it is locked by other user %s.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
index 367a93b..c5ba6d8 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilder.java
@@ -30,7 +30,7 @@
  */
 public class EditOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
 
-  private static final String EDIT_ON_UNLOCKED_ENTITY_MSG =
+   static final String EDIT_ON_UNLOCKED_ENTITY_MSG =
       "Can not edit versionable entity %s with id %s since it is not checked out.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java
index 8f80f6e..0e59159 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class EntityAlreadyExistErrorBuilder extends BaseErrorBuilder {
 
-  private static final String VERSIONABLE_ENTITY_ALREADY_EXIST_MSG =
+   static final String VERSIONABLE_ENTITY_ALREADY_EXIST_MSG =
       "Versionable entity %s with id %s already exist.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java
index bff3e82..7cd9721 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class EntityAlreadyFinalizedErrorBuilder extends BaseErrorBuilder {
 
-  private static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG =
+   static final String SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG =
       "Versionable entity %s with id %s can not be submitted since it is already final.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java
index 806557f..2eab4b5 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class EntityNotExistErrorBuilder extends BaseErrorBuilder {
 
-  private static final String VERSIONABLE_ENTITY_NOT_EXIST_MSG =
+   static final String VERSIONABLE_ENTITY_NOT_EXIST_MSG =
       "Versionable entity %s with id %s does not exist.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java
index d44b2c4..aba3b8a 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilder.java
@@ -27,7 +27,7 @@
  * The type Requested version invalid error builder.
  */
 public class RequestedVersionInvalidErrorBuilder extends BaseErrorBuilder {
-  private static final String REQUESTED_VERSION_INVALID_MSG = "Invalid requested version.";
+   static final String REQUESTED_VERSION_INVALID_MSG = "Invalid requested version.";
 
   /**
    * Instantiates a new Requested version invalid error builder.
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java
index 0075403..4ec5129 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class RevisionIdNotFoundErrorBuilder extends BaseErrorBuilder {
 
-  private static final String REVISION_ID_NOT_FOUND_MSG =
+   static final String REVISION_ID_NOT_FOUND_MSG =
       "Mandatory field revision id missing";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java
index 959c277..0bd1cb9 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class SubmitLockedEntityNotAllowedErrorBuilder extends BaseErrorBuilder {
 
-  private static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG =
+   static final String SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG =
       "Versionable entity %s with id %s can not be submitted since it is currently"
           + " locked by user %s.";
 
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java
index 2b90338..3ec4b6d 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class UndoCheckoutOnEntityLockedByOtherErrorBuilder extends BaseErrorBuilder {
 
-  private static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
+   static final String UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG =
       "Can not undo checkout on versionable entity %s with id %s since it is checked "
           +  "out by other user: %s.";
 
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java
index d56473f..12771ef 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilder.java
@@ -28,7 +28,7 @@
  */
 public class UndoCheckoutOnUnlockedEntityErrorBuilder extends BaseErrorBuilder {
 
-  private static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG =
+   static final String UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG =
       "Can not undo checkout on versionable entity %s with id %s since it is not checked out.";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
index f717e5d..2fbb880 100644
--- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/errors/VersionableSubEntityNotFoundErrorBuilder.java
@@ -32,9 +32,9 @@
  */
 public class VersionableSubEntityNotFoundErrorBuilder extends BaseErrorBuilder {
 
-  private static final String SUB_ENTITY_NOT_FOUND_MSG =
+   static final String SUB_ENTITY_NOT_FOUND_MSG =
       "%s with Id %s does not exist for %s with id %s and version %s";
-  private static final String SUB_ENTITIES_NOT_FOUND_MSG =
+   static final String SUB_ENTITIES_NOT_FOUND_MSG =
       "%ss with Ids %s do not exist for %s with id %s and version %s";
 
   /**
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilderTest.java
new file mode 100644
index 0000000..bc91614
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnEntityLockedByOtherErrorBuilderTest.java
@@ -0,0 +1,22 @@
+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;
+
+public class CheckinOnEntityLockedByOtherErrorBuilderTest {
+
+    @Test
+    public void test() {
+        CheckinOnEntityLockedByOtherErrorBuilder builder = new CheckinOnEntityLockedByOtherErrorBuilder("entityType",
+                "entityId", "lockingUser");
+        ErrorCode build = builder.build();
+
+        Assert.assertEquals(VersioningErrorCodes.CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(CheckinOnEntityLockedByOtherErrorBuilder.CHECKIN_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG, "entityType", "entityId", "lockingUser") ,  build.message());
+    }
+
+}
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilderTest.java
new file mode 100644
index 0000000..e72eefe
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckinOnUnlockedEntityErrorBuilderTest.java
@@ -0,0 +1,22 @@
+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;
+
+public class CheckinOnUnlockedEntityErrorBuilderTest {
+
+    @Test
+    public void test() {
+        CheckinOnUnlockedEntityErrorBuilder builder = new CheckinOnUnlockedEntityErrorBuilder("entityType",
+                "entityId");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.CHECKIN_ON_UNLOCKED_ENTITY, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(CheckinOnUnlockedEntityErrorBuilder.CHECKIN_ON_UNLOCKED_ENTITY_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilderTest.java
new file mode 100644
index 0000000..2a8cabb
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/CheckoutOnLockedEntityErrorBuilderTest.java
@@ -0,0 +1,22 @@
+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;
+
+public class CheckoutOnLockedEntityErrorBuilderTest {
+    @Test
+    public void test() {
+        CheckoutOnLockedEntityErrorBuilder builder = new CheckoutOnLockedEntityErrorBuilder("entityType",
+                "entityId", "lockingUser");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.CHECKOT_ON_LOCKED_ENTITY, build.id() );
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category() );
+        Assert.assertEquals(String.format(CheckoutOnLockedEntityErrorBuilder.CHECKOT_ON_LOCKED_ENTITY_MSG,
+                "entityType", "entityId", "lockingUser") ,  build.message());
+    }
+
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilderTest.java
new file mode 100644
index 0000000..523b226
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/DeleteOnLockedEntityErrorBuilderTest.java
@@ -0,0 +1,22 @@
+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;
+
+
+public class DeleteOnLockedEntityErrorBuilderTest {
+
+    @Test
+    public void test() {
+        DeleteOnLockedEntityErrorBuilder builder = new DeleteOnLockedEntityErrorBuilder("entityType",
+                "entityId", "lockingUser");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.DELETE_ON_LOCKED_ENTITY, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(DeleteOnLockedEntityErrorBuilder.DELETE_ON_LOCKED_ENTITY_MSG,
+                "entityType", "entityId", "lockingUser"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilderTest.java
new file mode 100644
index 0000000..b37a0e4
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnEntityLockedByOtherErrorBuilderTest.java
@@ -0,0 +1,21 @@
+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;
+
+
+public class EditOnEntityLockedByOtherErrorBuilderTest {
+    @Test
+    public void test() {
+        EditOnEntityLockedByOtherErrorBuilder builder = new EditOnEntityLockedByOtherErrorBuilder("entityType",
+                "entityId", "lockingUser");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(EditOnEntityLockedByOtherErrorBuilder.EDIT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG,
+                "entityType", "entityId", "lockingUser"),build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilderTest.java
new file mode 100644
index 0000000..b228761
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EditOnUnlockedEntityErrorBuilderTest.java
@@ -0,0 +1,21 @@
+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;
+
+public class EditOnUnlockedEntityErrorBuilderTest {
+    @Test
+    public void test() {
+        EditOnUnlockedEntityErrorBuilder builder = new EditOnUnlockedEntityErrorBuilder("entityType",
+                "entityId");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.EDIT_ON_UNLOCKED_ENTITY, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(EditOnUnlockedEntityErrorBuilder.EDIT_ON_UNLOCKED_ENTITY_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilderTest.java
new file mode 100644
index 0000000..17c0127
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyExistErrorBuilderTest.java
@@ -0,0 +1,20 @@
+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;
+
+public class EntityAlreadyExistErrorBuilderTest {
+    @Test
+    public void test() {
+        EntityAlreadyExistErrorBuilder builder = new EntityAlreadyExistErrorBuilder("entityType",
+                "entityId");
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.VERSIONABLE_ENTITY_ALREADY_EXIST, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(EntityAlreadyExistErrorBuilder.VERSIONABLE_ENTITY_ALREADY_EXIST_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilderTest.java
new file mode 100644
index 0000000..860219f
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityAlreadyFinalizedErrorBuilderTest.java
@@ -0,0 +1,20 @@
+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;
+
+public class EntityAlreadyFinalizedErrorBuilderTest {
+    @Test
+    public void test() {
+
+        EntityAlreadyFinalizedErrorBuilder builder = new EntityAlreadyFinalizedErrorBuilder("entityType",
+                "entityId");
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(EntityAlreadyFinalizedErrorBuilder.SUBMIT_FINALIZED_ENTITY_NOT_ALLOWED_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilderTest.java
new file mode 100644
index 0000000..9cf5cab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/EntityNotExistErrorBuilderTest.java
@@ -0,0 +1,20 @@
+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;
+
+public class EntityNotExistErrorBuilderTest {
+    @Test
+    public void test() {
+        EntityNotExistErrorBuilder builder = new EntityNotExistErrorBuilder("entityType",
+                "entityId");
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.VERSIONABLE_ENTITY_NOT_EXIST, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(EntityNotExistErrorBuilder.VERSIONABLE_ENTITY_NOT_EXIST_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilderTest.java
new file mode 100644
index 0000000..5aa9ff8
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RequestedVersionInvalidErrorBuilderTest.java
@@ -0,0 +1,18 @@
+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;
+
+public class RequestedVersionInvalidErrorBuilderTest {
+    @Test
+    public void test() {
+        RequestedVersionInvalidErrorBuilder builder = new RequestedVersionInvalidErrorBuilder();
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.REQUESTED_VERSION_INVALID, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(RequestedVersionInvalidErrorBuilder.REQUESTED_VERSION_INVALID_MSG, build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilderTest.java
new file mode 100644
index 0000000..e648663
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/RevisionIdNotFoundErrorBuilderTest.java
@@ -0,0 +1,18 @@
+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;
+
+public class RevisionIdNotFoundErrorBuilderTest {
+    @Test
+    public void test() {
+        RevisionIdNotFoundErrorBuilder builder = new RevisionIdNotFoundErrorBuilder();
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.MANDATORY_FIELD_REVISION_ID_MISSING, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(RevisionIdNotFoundErrorBuilder.REVISION_ID_NOT_FOUND_MSG, build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilderTest.java
new file mode 100644
index 0000000..0695cab
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/SubmitLockedEntityNotAllowedErrorBuilderTest.java
@@ -0,0 +1,21 @@
+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;
+
+public class SubmitLockedEntityNotAllowedErrorBuilderTest {
+    @Test
+    public void test() {
+        SubmitLockedEntityNotAllowedErrorBuilder builder = new SubmitLockedEntityNotAllowedErrorBuilder("entityType",
+                "entityId", "lockingUser");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(SubmitLockedEntityNotAllowedErrorBuilder.SUBMIT_LOCKED_ENTITY_NOT_ALLOWED_MSG,
+                "entityType", "entityId", "lockingUser"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilderTest.java
new file mode 100644
index 0000000..e19fec0
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnEntityLockedByOtherErrorBuilderTest.java
@@ -0,0 +1,22 @@
+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;
+
+public class UndoCheckoutOnEntityLockedByOtherErrorBuilderTest {
+    @Test
+    public void test() {
+
+        UndoCheckoutOnEntityLockedByOtherErrorBuilder builder = new UndoCheckoutOnEntityLockedByOtherErrorBuilder("entityType",
+                "entityId", "lockingUser");
+
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(UndoCheckoutOnEntityLockedByOtherErrorBuilder.UNDO_CHECKOUT_ON_ENTITY_LOCKED_BY_OTHER_USER_MSG,
+                "entityType", "entityId", "lockingUser"), build.message());
+    }
+}
\ No newline at end of file
diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilderTest.java
new file mode 100644
index 0000000..52599ec
--- /dev/null
+++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/test/java/org/openecomp/sdc/versioning/errors/UndoCheckoutOnUnlockedEntityErrorBuilderTest.java
@@ -0,0 +1,20 @@
+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;
+
+public class UndoCheckoutOnUnlockedEntityErrorBuilderTest {
+    @Test
+    public void test() {
+        UndoCheckoutOnUnlockedEntityErrorBuilder builder = new UndoCheckoutOnUnlockedEntityErrorBuilder("entityType",
+                "entityId");
+        ErrorCode build = builder.build();
+        Assert.assertEquals(VersioningErrorCodes.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY, build.id());
+        Assert.assertEquals(ErrorCategory.APPLICATION, build.category());
+        Assert.assertEquals(String.format(UndoCheckoutOnUnlockedEntityErrorBuilder.UNDO_CHECKOUT_ON_UNLOCKED_ENTITY_MSG,
+                "entityType", "entityId"), build.message());
+    }
+}
\ No newline at end of file
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 0000000..d269204
--- /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