Skip to content

Commit

Permalink
Test @NotNull and @notempty on the same field for issue #294
Browse files Browse the repository at this point in the history
  • Loading branch information
daivanov committed Oct 23, 2021
1 parent 9ef6201 commit 615dd1c
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Digits;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.NotEmpty;
Expand Down Expand Up @@ -32,6 +33,10 @@ public class ValidatedPojoMultipleConstraints {
@NotEmpty(message = "str too short")
private String str;

@NotNull
@NotEmpty
private String str2;

public Double getValue() {
return value;
}
Expand Down Expand Up @@ -64,6 +69,14 @@ public void setStr(String str) {
this.str = str;
}

public String getStr2() {
return str2;
}

public void setStr2(String str2) {
this.str2 = str2;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder(this.getClass().getSimpleName());
Expand All @@ -72,6 +85,7 @@ public String toString() {
sb.append("value2='").append(value2).append("\',");
sb.append("value3='").append(value3).append('\'');
sb.append("str='").append(str).append('\'');
sb.append("str2='").append(str2).append('\'');
sb.append('}');
return sb.toString();
}
Expand Down

0 comments on commit 615dd1c

Please sign in to comment.