From 53f5b2da1d07e29468d32e4d78d9d80bf00ee557 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Thu, 5 Oct 2023 19:23:50 +0200
Subject: [PATCH] OZG-3931 [test] fix sonar issue

---
 .../postfach/bayernid/BayernIdPostfachRemoteServiceTest.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mail-service/src/test/java/de/itvsh/ozg/mail/postfach/bayernid/BayernIdPostfachRemoteServiceTest.java b/mail-service/src/test/java/de/itvsh/ozg/mail/postfach/bayernid/BayernIdPostfachRemoteServiceTest.java
index 2e0e8678b..05efa9116 100644
--- a/mail-service/src/test/java/de/itvsh/ozg/mail/postfach/bayernid/BayernIdPostfachRemoteServiceTest.java
+++ b/mail-service/src/test/java/de/itvsh/ozg/mail/postfach/bayernid/BayernIdPostfachRemoteServiceTest.java
@@ -121,8 +121,9 @@ class BayernIdPostfachRemoteServiceTest {
 		void shouldThrowPostfachRuntimeException() {
 			when(webServiceTemplate.marshalSendAndReceive(any())).thenThrow(RuntimeException.class);
 
-			assertThatExceptionOfType(PostfachRuntimeException.class).isThrownBy(
-					() -> service.sendMessage(PostfachNachrichtTestFactory.create()));
+			var postfachNachricht = PostfachNachrichtTestFactory.create();
+
+			assertThatExceptionOfType(PostfachRuntimeException.class).isThrownBy(() -> service.sendMessage(postfachNachricht));
 		}
 
 		@Test
-- 
GitLab