From 1b09d06ddb5900ba729966152ba6b4819d8df0ac Mon Sep 17 00:00:00 2001
From: Krzysztof <krzysztof.witukiewicz@mgm-tp.com>
Date: Fri, 4 Apr 2025 14:23:55 +0200
Subject: [PATCH] OZG-7773 OZG-8001 Fix test

---
 .../alfa/vorgang/VorgangControllerITCase.java  | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

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 257f019b7f..36d0bc99fb 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)
-- 
GitLab