I have some entity which stored in db.
For example:
@Pattern(regexp = "male|female")
@Column(name = "sex")
private String sex;
Now I have some JUnit test codebut its test all fields.
Set<ConstraintViolation<Candidate>> violations = this.validator.validate(this.validCandidate, Candidate.class);
assertTrue(violations.isEmpty());
How can I test only sex for example?
Aucun commentaire:
Enregistrer un commentaire