diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-software-product-lib')
3 files changed, 10 insertions, 5 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilder.java index 5b0933d03f..3d6180c380 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilder.java @@ -23,11 +23,10 @@ import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProdu import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.common.errors.Messages; public class VendorSoftwareProductNotFoundErrorBuilder { - private static final String VSP_FOUND_MSG = "Vendor software product with Id %s not found."; - private static final String VSP_ID_AND_VERSION_ID_NOT_FOUND_MSG = "Vendor Software Product with id '%s' and version id '%s' not found."; private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); /** @@ -38,13 +37,13 @@ public class VendorSoftwareProductNotFoundErrorBuilder { public VendorSoftwareProductNotFoundErrorBuilder(String vendorSoftwareProductId) { builder.withId(VSP_NOT_FOUND); builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String.format(VSP_FOUND_MSG, vendorSoftwareProductId)); + builder.withMessage(Messages.VSP_NOT_FOUND.formatMessage(vendorSoftwareProductId)); } public VendorSoftwareProductNotFoundErrorBuilder(final String vendorSoftwareProductId, final String vendorSoftwareProductVersionId) { builder.withId(VSP_NOT_FOUND); builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String.format(VSP_ID_AND_VERSION_ID_NOT_FOUND_MSG, vendorSoftwareProductId, vendorSoftwareProductVersionId)); + builder.withMessage(Messages.VSP_VERSION_NOT_FOUND.formatMessage(vendorSoftwareProductId, vendorSoftwareProductVersionId)); } public ErrorCode build() { diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java index 21b2caee32..ab43fdc880 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductErrorCodes.java @@ -85,6 +85,11 @@ public class VendorSoftwareProductErrorCodes { public static final String VSP_UPLOAD_STATUS_NOT_FOUND_ERROR = "VSP_UPLOAD_STATUS_NOT_FOUND_ERROR"; public static final String VSP_UPLOAD_ALREADY_FINISHED_ERROR = "VSP_UPLOAD_ALREADY_FINISHED_ERROR"; public static final String VSP_UPLOAD_ALREADY_IN_STATUS_ERROR = "VSP_UPLOAD_ALREADY_IN_STATUS_ERROR"; + public static final String VSP_DELETE_ALREADY_IN_USE_BY_VF = "VSP_DELETE_ALREADY_IN_USE_BY_VF"; + public static final String VSP_DELETE_NOT_ARCHIVED = "VSP_DELETE_NOT_ARCHIVED"; + public static final String VSP_DELETE_GENERIC_ERROR = "VSP_DELETE_GENERIC_ERROR"; + public static final String VSP_DELETE_FROM_STORAGE_ERROR = "VSP_DELETE_FROM_STORAGE_ERROR"; + public static final String VSP_DELETE_FROM_DATABASE_ERROR = "VSP_DELETE_FROM_DATABASE_ERROR"; private VendorSoftwareProductErrorCodes() { } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java index 71b77b1ff5..0086dd02f4 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductNotFoundErrorBuilderTest.java @@ -16,6 +16,7 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.errors; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.openecomp.sdc.common.errors.Messages.VSP_VERSION_NOT_FOUND; import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.VSP_NOT_FOUND; import org.junit.jupiter.api.Test; @@ -40,7 +41,7 @@ class VendorSoftwareProductNotFoundErrorBuilderTest { final ErrorCode actualErrorCode = errorBuilder.build(); assertEquals(ErrorCategory.APPLICATION, actualErrorCode.category()); assertEquals(VSP_NOT_FOUND, actualErrorCode.id()); - final String expectedMsg = String.format("Vendor Software Product with id '%s' and version id '%s' not found.", vspId, vspVersionId); + final String expectedMsg = VSP_VERSION_NOT_FOUND.formatMessage(vspId, vspVersionId); assertEquals(expectedMsg, actualErrorCode.message()); } } |