Skip to content
Snippets Groups Projects
Commit 58f0a856 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-6162-include-archive-manager' (#502) from...

Merge pull request 'OZG-6162-include-archive-manager' (#502) from OZG-6162-include-archive-manager into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/vorgang-manager/pulls/502


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 4ec12054 9a7516c1
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,9 @@
<nachrichten-manager.version>2.14.0</nachrichten-manager.version>
<ozgcloud-starter.version>0.14.0-SNAPSHOT</ozgcloud-starter.version>
<notification-manager.version>2.12.0</notification-manager.version>
<collaboration-manager.version>0.4.0</collaboration-manager.version>
<collaboration-manager.version>0.5.0-SNAPSHOT</collaboration-manager.version>
<archive-manager.version>0.1.0-SNAPSHOT</archive-manager.version>
<document-manager.version>1.1.0-SNAPSHOT</document-manager.version>
<zip.version>2.11.5</zip.version>
<jsoup.version>1.15.3</jsoup.version>
......@@ -157,6 +159,11 @@
<artifactId>collaboration-manager-server</artifactId>
<version>${collaboration-manager.version}</version>
</dependency>
<dependency>
<groupId>de.ozgcloud.archive</groupId>
<artifactId>archive-manager-server</artifactId>
<version>${archive-manager.version}</version>
</dependency>
<!-- Spring -->
<dependency>
......@@ -265,6 +272,12 @@
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.ozgcloud.document</groupId>
<artifactId>document-manager-server</artifactId>
<version>${document-manager.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>de.ozgcloud.nachrichten</groupId>
<artifactId>nachrichten-manager-interface</artifactId>
......
......@@ -42,6 +42,7 @@ import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
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.boot.test.mock.mockito.SpyBean;
......@@ -62,6 +63,7 @@ import de.ozgcloud.command.CommandStatus;
import de.ozgcloud.common.test.DataITCase;
import de.ozgcloud.document.BescheidDocumentCreatedEvent;
import de.ozgcloud.document.Document;
import de.ozgcloud.document.DocumentManagerConfiguration;
import de.ozgcloud.document.DocumentService;
import de.ozgcloud.document.common.attached_item.AttachedItemService;
import de.ozgcloud.nachrichten.postfach.PostfachAddressTestFactory;
......@@ -110,7 +112,8 @@ class BescheidITCase {
@MockBean
private PostfachRemoteService postfachRemoteService;
@MockBean
private OzgCloudUserProfileService userProfileService;
@Qualifier(DocumentManagerConfiguration.USER_PROFILE_SERVICE_NAME)
private OzgCloudUserProfileService documentUserProfileService;
@Captor
private ArgumentCaptor<BescheidDocumentCreatedEvent> bescheidDocumentCreatedEventCaptor;
......@@ -120,7 +123,7 @@ class BescheidITCase {
mongoOperations.dropCollection(VorgangAttachedItem.COLLECTION_NAME);
mongoOperations.dropCollection(Vorgang.COLLECTION_NAME);
when(postfachRemoteService.getPostfachType()).thenReturn(ServiceKontoTestFactory.TYPE);
when(userProfileService.getById(any())).thenReturn(OzgCloudUserProfile.builder().id(OzgCloudUserId.from(USER_ID)).build());
when(documentUserProfileService.getById(any())).thenReturn(OzgCloudUserProfile.builder().id(OzgCloudUserId.from(USER_ID)).build());
}
@Nested
......
......@@ -25,16 +25,21 @@ package de.ozgcloud.vorgang;
import static org.mockito.Mockito.*;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.mail.javamail.JavaMailSender;
import de.ozgcloud.archive.common.callcontext.CallContextProvider;
@Configuration
public class TestConfiguration {
@MockBean
private CallContextProvider callContextProvider;
@Bean
public JavaMailSender mockMailSender() {
JavaMailSender mockMailSender() {
return mock(JavaMailSender.class);
}
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment