Improve error's message readability 37/130437/2
authorvasraz <vasyl.razinkov@est.tech>
Wed, 24 Aug 2022 14:11:51 +0000 (15:11 +0100)
committerMichael Morris <michael.morris@est.tech>
Fri, 26 Aug 2022 09:07:50 +0000 (09:07 +0000)
Signed-off-by: Vasyl Razinkov <vasyl.razinkov@est.tech>
Change-Id: Id8e9c3ce84c4f8b18a1c2fb564eb4347ce514adc
Issue-ID: SDC-4143

openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java
openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilderTest.java

index 1555bd7..49ef093 100644 (file)
  */
 package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
+import lombok.AccessLevel;
+import lombok.NoArgsConstructor;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
+@NoArgsConstructor(access = AccessLevel.PRIVATE)
 public class VendorSoftwareProductInvalidErrorBuilder {
 
-    private static final String VSP_INVALID_MSG =
-        "Vendor software product with Id %s and version %s is invalid - does not contain " + "service model.";
-    private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG =
-        "VSP has to have a " + "minimum of one Deployment Flavor defined for being able to be instantiated.Please add a "
-            + "Deployment Flavor and re-submit the VSP.";
-    private static final String CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED = "Uploaded network package" + " file %s was not processed/aborted.";
-    private static final String INVALID_PROCESSED_CANDIDATE = "Uploaded network package file %s" + " is invalid and need to be aborted";
-
-    private VendorSoftwareProductInvalidErrorBuilder() {
-    }
+    private static final String VSP_INVALID_MSG = "Vendor software product with Id %s and version %s is invalid - does not contain service model.";
+    private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG = "VSP has to have a minimum of one Deployment Flavor defined for being able to be instantiated.Please add a Deployment Flavor and re-submit the VSP.";
+    private static final String CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED = "Uploaded network package file %s was not processed/aborted.";
+    private static final String INVALID_PROCESSED_CANDIDATE = "Uploaded network package file %s is invalid and need to be aborted";
 
     /**
      * Instantiates a new Vendor software product invalid error builder.
index a54304d..08ab416 100644 (file)
@@ -22,29 +22,29 @@ package org.openecomp.sdc.vendorsoftwareproduct.errors;
 
 import static org.junit.Assert.assertEquals;
 
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
 import org.openecomp.sdc.common.errors.ErrorCategory;
 import org.openecomp.sdc.common.errors.ErrorCode;
 import org.openecomp.sdc.versioning.dao.types.Version;
 
-public class VendorSoftwareProductInvalidErrorBuilderTest {
+class VendorSoftwareProductInvalidErrorBuilderTest {
 
     @Test
-    public void testVendorSoftwareProductMissingServiceModelErrorBuilder() {
+    void testVendorSoftwareProductMissingServiceModelErrorBuilder() {
         //when
         ErrorCode errorCode = VendorSoftwareProductInvalidErrorBuilder
-                                      .vendorSoftwareProductMissingServiceModelErrorBuilder("1",
-                                              Version.valueOf("1.1"));
+            .vendorSoftwareProductMissingServiceModelErrorBuilder("1",
+                Version.valueOf("1.1"));
 
         //then
         assertEquals(VendorSoftwareProductErrorCodes.VSP_INVALID, errorCode.id());
         assertEquals(ErrorCategory.APPLICATION, errorCode.category());
         assertEquals("Vendor software product with Id 1 and version null is invalid - does not contain service model.",
-                errorCode.message());
+            errorCode.message());
     }
 
     @Test
-    public void testVspMissingDeploymentFlavorErrorBuilder() {
+    void testVspMissingDeploymentFlavorErrorBuilder() {
         //when
         ErrorCode errorCode = VendorSoftwareProductInvalidErrorBuilder.vspMissingDeploymentFlavorErrorBuilder();
 
@@ -52,7 +52,7 @@ public class VendorSoftwareProductInvalidErrorBuilderTest {
         assertEquals(VendorSoftwareProductErrorCodes.VSP_INVALID, errorCode.id());
         assertEquals(ErrorCategory.APPLICATION, errorCode.category());
         assertEquals(
-                "VSP has to have a minimum of one Deployment Flavor defined for being able to be instantiated.Please add a "
-                        + "Deployment Flavor and re-submit the VSP.", errorCode.message());
+            "VSP has to have a minimum of one Deployment Flavor defined for being able to be instantiated.Please add a "
+                + "Deployment Flavor and re-submit the VSP.", errorCode.message());
     }
 }