Fix test.

This commit is contained in:
Paulo Gustavo Veiga
2024-01-23 22:20:10 -08:00
parent ccfcb3b335
commit 740da238fa
8 changed files with 248 additions and 244 deletions

View File

@@ -73,7 +73,7 @@ public class Label implements Serializable {
return title;
}
public void setTitle(@NotNull String title) {
public void setTitle(String title) {
this.title = title;
}
@@ -85,7 +85,7 @@ public class Label implements Serializable {
this.id = id;
}
@NotNull
@Nullable
public String getColor() {
return color;
}

View File

@@ -30,7 +30,7 @@ public class RestLabel {
this.label = label;
}
public void setParent(@NotNull final Label parent) {
public void setParent(final Label parent) {
this.label.setParent(parent);
}

View File

@@ -55,14 +55,23 @@ public class LabelValidator implements Validator {
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "title", Messages.FIELD_REQUIRED);
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "color", Messages.FIELD_REQUIRED);
final String title = label.getTitle();
ValidatorUtils.rejectIfExceeded(
errors,
"title",
"The description must have less than " + Constants.MAX_LABEL_NAME_LENGTH + " characters.",
title,
Constants.MAX_LABEL_NAME_LENGTH);
ValidatorUtils.rejectIfEmptyOrWhitespace(
errors,
"title",
"Label title can not be empty",
title);
final User user = com.wisemapping.security.Utils.getUser();
assert user != null;
final Label foundLabel = service.getLabelByTitle(title, user);
if (foundLabel != null) {
errors.rejectValue("title", Messages.LABEL_TITLE_ALREADY_EXISTS);

View File

@@ -12,7 +12,7 @@ spring.sql.init.mode=always
spring.sql.init.platform=hsqldb
# LOG
logging.level.root=INFO
logging.level.root=DEBUG
logging.level.org.apache.tomcat=INFO
##################################################################################