From c18ed4ac665c73f45a91ed2baa23ee733cc1ac18 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Tue, 5 Nov 2024 13:28:31 +0100
Subject: [PATCH] OZG-6162 add qualifier in CollaborationITCase

---
 .../vorgang/collaboration/CollaborationITCase.java       | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java b/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java
index 2a9d86590..f73ea147c 100644
--- a/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java
+++ b/vorgang-manager-server/src/test/java/de/ozgcloud/vorgang/collaboration/CollaborationITCase.java
@@ -47,6 +47,7 @@ import org.mockito.ArgumentCaptor;
 import org.mockito.Captor;
 import org.mockito.Mock;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Qualifier;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.mock.mockito.MockBean;
 import org.springframework.data.mongodb.core.MongoOperations;
@@ -61,6 +62,7 @@ import com.thedeanda.lorem.LoremIpsum;
 import de.ozgcloud.apilib.user.OzgCloudUserId;
 import de.ozgcloud.apilib.user.OzgCloudUserProfile;
 import de.ozgcloud.apilib.user.OzgCloudUserProfileService;
+import de.ozgcloud.collaboration.CollaborationManagerConfiguration;
 import de.ozgcloud.collaboration.CollaborationRequest;
 import de.ozgcloud.collaboration.CollaborationServiceGrpc.CollaborationServiceBlockingStub;
 import de.ozgcloud.collaboration.GrpcGetFileContentRequest;
@@ -122,7 +124,8 @@ class CollaborationITCase {
 	private MongoOperations mongoOperations;
 
 	@MockBean
-	private OzgCloudUserProfileService ozgCloudUserProfileService;
+	@Qualifier(CollaborationManagerConfiguration.OZG_CLOUD_USER_PROFILE_SERVICE_NAME)
+	private OzgCloudUserProfileService collaborationOzgCloudUserProfileService;
 	@MockBean
 	private PostfachRemoteService postfachRemoteService;
 
@@ -241,7 +244,7 @@ class CollaborationITCase {
 		@BeforeEach
 		void init() {
 			when(ozgCloudUserProfile.getId()).thenReturn(OzgCloudUserId.from(CommandTestFactory.CREATED_BY));
-			when(ozgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile);
+			when(collaborationOzgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile);
 		}
 
 		@Test
@@ -289,7 +292,7 @@ class CollaborationITCase {
 		@BeforeEach
 		void init() {
 			when(ozgCloudUserProfile.getId()).thenReturn(OzgCloudUserId.from(CommandTestFactory.CREATED_BY));
-			when(ozgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile);
+			when(collaborationOzgCloudUserProfileService.getById(any())).thenReturn(ozgCloudUserProfile);
 		}
 
 		@Test
-- 
GitLab