75451: Make error messages public

The messages can then be used in the integration tests,
instead of hardcoding the expected response.
This commit is contained in:
Bruno Roemers
2021-01-08 08:46:17 +01:00
parent e5bc76af04
commit ea613aa72f
3 changed files with 6 additions and 6 deletions

View File

@@ -21,11 +21,11 @@ import java.util.UUID;
*/
public class EmptyWorkflowGroupException extends IllegalStateException {
public static final String msgFmt = "Refused to delete user %s because it is the only member of the " +
"workflow group %s. Delete the tasks and group first if you want to remove this user.";
public EmptyWorkflowGroupException(UUID ePersonId, UUID groupId) {
super(String.format(
"Refused to delete user %s because it is the only member of the workflow group %s. " +
"Delete the tasks and group first if you want to remove this user.", ePersonId, groupId
));
super(String.format(msgFmt, ePersonId, groupId));
}
}

View File

@@ -17,7 +17,7 @@ package org.dspace.app.rest.exception;
*/
public class EPersonNameNotProvidedException extends UnprocessableEntityException {
private static final String message = "The eperson.firstname and eperson.lastname values need to be filled in";
public static final String message = "The eperson.firstname and eperson.lastname values need to be filled in";
public EPersonNameNotProvidedException() {
super(message);

View File

@@ -17,7 +17,7 @@ package org.dspace.app.rest.exception;
*/
public class GroupNameNotProvidedException extends UnprocessableEntityException {
private static final String message = "cannot create group, no group name is provided";
public static final String message = "cannot create group, no group name is provided";
public GroupNameNotProvidedException() {
super(message);