Fixing error message for invalid values across SDC backend API.
Issue-ID: SDC-2324
Change-Id: If01307138baf7692e398abf20eb75bbe9a8aa394
Signed-off-by: aribeiro <anderson.ribeiro@est.tech>
# %1 - resource/service
COMPONENT_INVALID_CATEGORY: {
code: 400,
- message: "Error: Invalid Content. Invalid %1 category.",
+ message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
messageId: "SVC4054"
}
#---------SVC4055------------------------------
# %1 - Service/Resource
INVALID_COMPONENT_NAME: {
code: 400,
- message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4070"
}
#---------SVC4071------------------------------
INVALID_VENDOR_NAME: {
code: 400,
- message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4071"
}
#---------SVC4072------------------------------
INVALID_VENDOR_RELEASE: {
code: 400,
- message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4072"
}
#---------SVC4073------------------------------
log.info("vendor release is not valid.");
ResponseFormat errorResponse = componentsUtils.getResponseFormat(ActionStatus.INVALID_VENDOR_RELEASE);
componentsUtils.auditResource(errorResponse, user, resource, actionEnum);
- throw new ByActionStatusComponentException(ActionStatus.INVALID_VENDOR_RELEASE);
+ throw new ByActionStatusComponentException(ActionStatus.INVALID_VENDOR_RELEASE, vendorRelease);
}
}
}
log.info("vendor name is not valid.");
ResponseFormat errorResponse = componentsUtils.getResponseFormat(ActionStatus.INVALID_VENDOR_NAME);
componentsUtils.auditResource(errorResponse, user, resource, actionEnum);
- throw new ByActionStatusComponentException(ActionStatus.INVALID_VENDOR_NAME);
+ throw new ByActionStatusComponentException(ActionStatus.INVALID_VENDOR_NAME, vendorName);
}
}
}
# %1 - resource/service
COMPONENT_INVALID_CATEGORY: {
code: 400,
- message: "Error: Invalid Content. Invalid %1 category.",
+ message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
messageId: "SVC4054"
}
#---------SVC4055------------------------------
# %1 - Service/Resource
INVALID_COMPONENT_NAME: {
code: 400,
- message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4070"
}
#---------SVC4071------------------------------
INVALID_VENDOR_NAME: {
code: 400,
- message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4071"
}
#---------SVC4072------------------------------
INVALID_VENDOR_RELEASE: {
code: 400,
- message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4072"
}
#---------SVC4073------------------------------
try {
bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null);
} catch (ByActionStatusComponentException e) {
- assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME);
+ assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME, nameWrongFormat);
}
}
private void testVendorReleaseWrongFormat() {
Resource resource = createResourceObject(false);
// contains >
- String nameWrongFormat = "1>2";
- resource.setVendorRelease(nameWrongFormat);
+ String vendorReleaseWrongFormat = "1>2";
+ resource.setVendorRelease(vendorReleaseWrongFormat);
try {
bl.createResource(resource, AuditingActionEnum.CREATE_RESOURCE, user, null, null);
} catch (ByActionStatusComponentException e) {
- assertComponentException(e, ActionStatus.INVALID_VENDOR_RELEASE);
+ assertComponentException(e, ActionStatus.INVALID_VENDOR_RELEASE, vendorReleaseWrongFormat);
}
}
try {
bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false);
} catch (ByActionStatusComponentException e) {
- assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME);
+ assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME, nameWrongFormat);
}
}
try {
bl.updateResourceMetadata(resource.getUniqueId(), updatedResource, null, user, false);
} catch (ByActionStatusComponentException e) {
- assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME);
+ assertComponentException(e, ActionStatus.INVALID_VENDOR_NAME, nameWrongFormat);
}
}
# %1 - resource/service
COMPONENT_INVALID_CATEGORY: {
code: 400,
- message: "Error: Invalid Content. Invalid %1 category.",
+ message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
messageId: "SVC4054"
}
#---------SVC4055------------------------------
# %1 - Service/Resource
INVALID_COMPONENT_NAME: {
code: 400,
- message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4070"
}
#---------SVC4071------------------------------
INVALID_VENDOR_NAME: {
code: 400,
- message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4071"
}
#---------SVC4072------------------------------
INVALID_VENDOR_RELEASE: {
code: 400,
- message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4072"
}
#---------SVC4073------------------------------
# %1 - resource/service
COMPONENT_INVALID_CATEGORY: {
code: 400,
- message: "Error: Invalid Content. Invalid %1 category.",
+ message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
messageId: "SVC4054"
}
#---------SVC4055------------------------------
# %1 - Service/Resource
INVALID_COMPONENT_NAME: {
code: 400,
- message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4070"
}
#---------SVC4071------------------------------
INVALID_VENDOR_NAME: {
code: 400,
- message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4071"
}
#---------SVC4072------------------------------
INVALID_VENDOR_RELEASE: {
code: 400,
- message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4072"
}
#---------SVC4073------------------------------
# %1 - resource/service
COMPONENT_INVALID_CATEGORY: {
code: 400,
- message: "Error: Invalid Content. Invalid %1 category.",
+ message: "Error: Invalid Content. Value %1 for the field Category is invalid.",
messageId: "SVC4054"
}
#---------SVC4055------------------------------
# %1 - Service/Resource
INVALID_COMPONENT_NAME: {
code: 400,
- message: 'Error: Invalid Content. %1 name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for Component name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4070"
}
#---------SVC4071------------------------------
INVALID_VENDOR_NAME: {
code: 400,
- message: 'Error: Invalid Content. Vendor name is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor name is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4071"
}
#---------SVC4072------------------------------
INVALID_VENDOR_RELEASE: {
code: 400,
- message: 'Error: Invalid Content. Vendor release is not allowed to contain characters like <>:"\/|?* and space characters other than regular space.',
+ message: 'Error: Invalid Content. Value %1 for the field Vendor release is invalid. Only alphanumeric characters and regular spaces are allowed.',
messageId: "SVC4072"
}
#---------SVC4073------------------------------