Skip to content
Snippets Groups Projects
Commit 55e2e22d authored by OZGCloud's avatar OZGCloud
Browse files

OZG-7350 add not null validation to type of Fachstelle

parent 36d74875
Branches
Tags
No related merge requests found
package de.ozgcloud.collaboration.fachstelle;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.EqualsAndHashCode;
......@@ -19,6 +20,7 @@ public class Fachstelle {
private String technicalId;
@NotBlank
private String subjectId;
@NotNull
private FachstelleType type;
public enum FachstelleType {
......
......@@ -94,6 +94,16 @@ class CollaborationServiceITCase {
assertThrows(ConstraintViolationException.class, () -> service.createCollaborationRequest(request));
}
@DisplayName("should validate type of zustaendigeStelle")
@Test
void shouldValidateCollaborationZustaendigeStelleType() {
var request = CollaborationRequestTestFactory.createBuilder()
.zustaendigeStelle(FachstelleTestFactory.createBuilder().type(null).build())
.build();
assertThrows(ConstraintViolationException.class, () -> service.createCollaborationRequest(request));
}
@DisplayName("should validate zustaendigeStelle")
@Test
void shouldValidateCollaborationZustaendigeStelle() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment