diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/vorgang/VorgangControllerITCase.java b/alfa-service/src/test/java/de/ozgcloud/alfa/vorgang/VorgangControllerITCase.java index 257f019b7ffc2ba3f4a0b10f74139f3ed49cc4b5..36d0bc99fb051803fe2996fed0ffab28355bf81c 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/vorgang/VorgangControllerITCase.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/vorgang/VorgangControllerITCase.java @@ -39,6 +39,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; import org.springframework.boot.test.context.SpringBootTest; @@ -281,24 +283,16 @@ class VorgangControllerITCase { @Nested class TestClientAttribute { - @Test - void shouldReturnNoContent() throws Exception { - var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(false); + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void shouldReturnNoContent(boolean hasNewPostfachNachricht) throws Exception { + var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(hasNewPostfachNachricht); var response = doRequest(content); response.andExpect(status().isNoContent()); } - @Test - void shouldReturnUnprocessableEntity() throws Exception { - var content = VorgangHeaderTestFactory.createHasNewPostfachNachrichtContent(true); - - var response = doRequest(content); - - response.andExpect(status().isUnprocessableEntity()); - } - private ResultActions doRequest(String content) throws Exception { return mockMvc.perform(put("/api/vorgangs/{0}/hasNewPostfachNachricht", VorgangHeaderTestFactory.ID).with(csrf()) .contentType(MediaType.APPLICATION_JSON)