diff --git a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationMapper.java b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationMapper.java index eaaf9988dc719a28ae25be0010a7f6b99754af37..6488d9881cdc964bcaf54e4dbb9dcc4cfb1a01a3 100644 --- a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationMapper.java +++ b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationMapper.java @@ -1,6 +1,7 @@ package de.ozgcloud.alfa.collaboration; import org.mapstruct.Mapper; +import org.mapstruct.Mapping; import org.mapstruct.NullValueCheckStrategy; import org.mapstruct.ReportingPolicy; @@ -9,7 +10,17 @@ import de.ozgcloud.collaboration.request.GrpcCollaborationRequest; @Mapper(unmappedTargetPolicy = ReportingPolicy.ERROR, nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS) interface CollaborationMapper { - OrganisationsEinheitCollaboration fromOrganisationsEinheitRequest(GrpcCollaborationRequest request, String vorgangId); + default Collaboration fromCollaborationRequest(GrpcCollaborationRequest request) { + return isFachstelle(request) ? fromFachstelleRequest(request) : fromOrganisationsEinheitRequest(request); + } - FachstelleCollaboration fromFachstelleRequest(GrpcCollaborationRequest request, String vorgangId); + default boolean isFachstelle(GrpcCollaborationRequest request) { + return Long.valueOf(4).equals(request.getCollaborationLevel()); + } + + @Mapping(target = "vorgangId", ignore = true) + OrganisationsEinheitCollaboration fromOrganisationsEinheitRequest(GrpcCollaborationRequest request); + + @Mapping(target = "vorgangId", ignore = true) + FachstelleCollaboration fromFachstelleRequest(GrpcCollaborationRequest request); } diff --git a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteService.java b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteService.java index b0d34a700a5df2e7f9bb17e3632e15fcdbf81598..6baedde96aaa3d3a51b349701d1bf7b29d6a1079 100644 --- a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteService.java +++ b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteService.java @@ -1,6 +1,5 @@ package de.ozgcloud.alfa.collaboration; -import java.util.function.Function; import java.util.stream.Stream; import org.springframework.beans.factory.annotation.Autowired; @@ -8,7 +7,6 @@ import org.springframework.stereotype.Service; import de.ozgcloud.alfa.common.GrpcUtil; import de.ozgcloud.collaboration.request.CollaborationRequestServiceGrpc.CollaborationRequestServiceBlockingStub; -import de.ozgcloud.collaboration.request.GrpcCollaborationRequest; import de.ozgcloud.collaboration.request.GrpcFindRequestsRequest; import de.ozgcloud.collaboration.request.GrpcGetRequestRequest; import net.devh.boot.grpc.client.inject.GrpcClient; @@ -20,16 +18,16 @@ public class CollaborationRemoteService { private CollaborationRequestServiceBlockingStub serviceStub; @Autowired - private CollaborationMapper collaborationMapper; + private CollaborationMapper mapper; -// public Collaboration getById(String collaborationId) { -// serviceStub.getRequest() -// } + public Collaboration getById(String collaborationId) { + return mapper.fromCollaborationRequest(serviceStub.getRequest(buildGetRequest(collaborationId)).getRequest()); + } public Stream<Collaboration> getCollaborations(String vorgangId) { - var toCollaboration = getCollaborationMapperForVorgang(vorgangId); return serviceStub.findRequests(buildSearchRequest(vorgangId)) - .getRequestsList().stream().map(toCollaboration); + .getRequestsList().stream() + .map(mapper::fromCollaborationRequest); } GrpcGetRequestRequest buildGetRequest(String collaborationId) { @@ -39,14 +37,4 @@ public class CollaborationRemoteService { GrpcFindRequestsRequest buildSearchRequest(String vorgangId) { return GrpcFindRequestsRequest.newBuilder().setVorgangId(vorgangId).build(); } - - private Function<GrpcCollaborationRequest, Collaboration> getCollaborationMapperForVorgang(String vorgangId) { - return request -> isFachstelle(request) - ? collaborationMapper.fromFachstelleRequest(request, vorgangId) - : collaborationMapper.fromOrganisationsEinheitRequest(request, vorgangId); - } - - private boolean isFachstelle(GrpcCollaborationRequest request) { - return Long.valueOf(4).equals(request.getCollaborationLevel()); - } } diff --git a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationService.java b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationService.java index 32a4bb5ad3c2e9bc9b4aed32de405a1a8feb67cb..eafbaabcd5266ebda59baf71c29755c4b250340e 100644 --- a/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationService.java +++ b/alfa-service/src/main/java/de/ozgcloud/alfa/collaboration/CollaborationService.java @@ -13,7 +13,7 @@ class CollaborationService { private final CollaborationRemoteService remoteService; public Collaboration getById(String collaborationId) { - return null; + return remoteService.getById(collaborationId); } public Stream<Collaboration> getCollaborations(String vorgangId) { diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationByVorgangControllerTest.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationByVorgangControllerTest.java index 312ec2eac9c35234894fb53eae3804fef2387e15..cc009ac044d4710239eb8163876e9f20f6f7a339 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationByVorgangControllerTest.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationByVorgangControllerTest.java @@ -19,6 +19,7 @@ import org.springframework.test.web.servlet.ResultActions; import org.springframework.test.web.servlet.setup.MockMvcBuilders; import de.ozgcloud.alfa.collaboration.CollaborationController.CollaborationByVorgangController; +import de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory; import lombok.SneakyThrows; class CollaborationByVorgangControllerTest { @@ -34,7 +35,7 @@ class CollaborationByVorgangControllerTest { private MockMvc mockMvc; - private static final String VORGANG_ID = OrganisationsEinheitCollaborationTestFactory.VORGANG_ID; + private static final String VORGANG_ID = VorgangHeaderTestFactory.ID; @BeforeEach void initTest() { diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationMapperTest.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationMapperTest.java index 3bafe806234b057a7fc3f71260979ca0b246b8d0..2008deaf8d53ccb0b0720024b2b859455c6494b5 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationMapperTest.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationMapperTest.java @@ -1,24 +1,117 @@ package de.ozgcloud.alfa.collaboration; import static org.assertj.core.api.Assertions.*; +import static org.mockito.Mockito.*; +import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Nested; import org.junit.jupiter.api.Test; import org.mapstruct.factory.Mappers; import org.mockito.Spy; +import de.ozgcloud.collaboration.request.GrpcCollaborationRequest; + class CollaborationMapperTest { @Spy private CollaborationMapper mapper = Mappers.getMapper(CollaborationMapper.class); + @Nested + class TestFromCollaborationRequest { + + @Nested + class OnOrganisationsEinheitRequest { + + public final GrpcCollaborationRequest request = GrpcFindRequestsResponseTestFactory.COLLABORATION_REQUEST; + public final OrganisationsEinheitCollaboration collaboration = OrganisationsEinheitCollaborationTestFactory.create(); + + @BeforeEach + void init() { + doReturn(false).when(mapper).isFachstelle(request); + doReturn(collaboration).when(mapper).fromOrganisationsEinheitRequest(request); + } + + @Test + void shouldCheckForFachstelleRequest() { + mapper.fromCollaborationRequest(request); + + verify(mapper).isFachstelle(request); + } + + @Test + void shouldMapToOrganisationsEinheitCollaboration() { + mapper.fromCollaborationRequest(request); + + verify(mapper).fromOrganisationsEinheitRequest(request); + } + + @Test + void shouldReturnOrganisationsEinheitCollaboration() { + var mapped = mapper.fromCollaborationRequest(request); + + assertThat(mapped).isEqualTo(collaboration); + } + } + + @Nested + class OnFachstelleRequest { + + public final GrpcCollaborationRequest request = GrpcFindRequestsResponseTestFactory.COLLABORATION_REQUEST; + public final FachstelleCollaboration collaboration = FachstelleCollaborationTestFactory.create(); + + @BeforeEach + void init() { + doReturn(true).when(mapper).isFachstelle(request); + doReturn(collaboration).when(mapper).fromFachstelleRequest(request); + } + + @Test + void shouldCheckForFachstelleRequest() { + mapper.fromCollaborationRequest(request); + + verify(mapper).isFachstelle(request); + } + + @Test + void shouldMapToFachstelleCollaboration() { + mapper.fromCollaborationRequest(request); + + verify(mapper).fromFachstelleRequest(request); + } + + @Test + void shouldReturnFachstelleCollaboration() { + var mapped = mapper.fromCollaborationRequest(request); + + assertThat(mapped).isEqualTo(collaboration); + } + } + } + + @Nested + class TestIsFachstelle { + + @Test + void shouldReturnTrue() { + var fachstelle = mapper.isFachstelle(GrpcCollaborationRequestForFachstelleTestFactory.create()); + + assertThat(fachstelle).isTrue(); + } + + @Test + void shouldReturnFalse() { + var fachstelle = mapper.isFachstelle(GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create()); + + assertThat(fachstelle).isFalse(); + } + } + @Nested class TestFromOrganisationsEinheitRequest { @Test void shouldMap() { - var collaboration = mapper.fromOrganisationsEinheitRequest(GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create(), - OrganisationsEinheitCollaborationTestFactory.VORGANG_ID); + var collaboration = mapper.fromOrganisationsEinheitRequest(GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create()); assertThat(collaboration).usingRecursiveComparison().isEqualTo(OrganisationsEinheitCollaborationTestFactory.create()); } @@ -29,8 +122,7 @@ class CollaborationMapperTest { @Test void shouldMap() { - var collaboration = mapper.fromFachstelleRequest(GrpcCollaborationRequestForFachstelleTestFactory.create(), - FachstelleCollaborationTestFactory.VORGANG_ID); + var collaboration = mapper.fromFachstelleRequest(GrpcCollaborationRequestForFachstelleTestFactory.create()); assertThat(collaboration).usingRecursiveComparison().isEqualTo(FachstelleCollaborationTestFactory.create()); } diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteServiceTest.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteServiceTest.java index 35460205434ae786ff43485c893559d3e9c209dd..15d95d8a80969d824bfa6d7e4fce83d5d26f8771 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteServiceTest.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationRemoteServiceTest.java @@ -10,9 +10,10 @@ import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.Spy; +import de.ozgcloud.alfa.vorgang.VorgangHeaderTestFactory; import de.ozgcloud.collaboration.request.CollaborationRequestServiceGrpc.CollaborationRequestServiceBlockingStub; -import de.ozgcloud.collaboration.request.GrpcCollaborationRequest; import de.ozgcloud.collaboration.request.GrpcFindRequestsRequest; +import de.ozgcloud.collaboration.request.GrpcGetRequestRequest; class CollaborationRemoteServiceTest { @@ -24,23 +25,62 @@ class CollaborationRemoteServiceTest { @Mock private CollaborationMapper mapper; + @Nested + class TestGetById { + + public static final String COLLABORATION_ID = GrpcGetRequestRequestTestFactory.COLLABORATION_ID; + + private final GrpcGetRequestRequest request = GrpcGetRequestRequestTestFactory.create(); + private final Collaboration collaboration = OrganisationsEinheitCollaborationTestFactory.create(); + + @BeforeEach + void init() { + when(stub.getRequest(request)).thenReturn(GrpcGetRequestResponseTestFactory.create()); + when(mapper.fromCollaborationRequest(GrpcGetRequestResponseTestFactory.COLLABORATION_REQUEST)).thenReturn(collaboration); + } + + @Test + void shouldBuildGetRequest() { + service.getById(COLLABORATION_ID); + + verify(service).buildGetRequest(COLLABORATION_ID); + } + + @Test + void shouldGetRequest() { + service.getById(COLLABORATION_ID); + + verify(stub).getRequest(request); + } + + @Test + void shouldMapFromCollaborationRequest() { + service.getById(COLLABORATION_ID); + + verify(mapper).fromCollaborationRequest(GrpcGetRequestResponseTestFactory.COLLABORATION_REQUEST); + } + + @Test + void shouldReturnCollaboration() { + var collaborationById = service.getById(COLLABORATION_ID); + + assertThat(collaborationById).isEqualTo(collaboration); + } + } + @Nested class TestGetCollaborations { - public static final String VORGANG_ID = FachstelleCollaborationTestFactory.VORGANG_ID; + public static final String VORGANG_ID = VorgangHeaderTestFactory.ID; private final GrpcFindRequestsRequest searchRequest = GrpcFindRequestsRequestTestFactory.create(); - private final GrpcCollaborationRequest organisationsEinheitRequest = GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create(); - private final GrpcCollaborationRequest fachstelleRequest = GrpcCollaborationRequestForFachstelleTestFactory.create(); - private final OrganisationsEinheitCollaboration organisationsEinheitCollaboration = OrganisationsEinheitCollaborationTestFactory.create(); - private final FachstelleCollaboration fachstelleCollaboration = FachstelleCollaborationTestFactory.create(); + private final Collaboration collaboration = OrganisationsEinheitCollaborationTestFactory.create(); @BeforeEach void init() { doReturn(searchRequest).when(service).buildSearchRequest(VORGANG_ID); when(stub.findRequests(searchRequest)).thenReturn(GrpcFindRequestsResponseTestFactory.create()); - when(mapper.fromOrganisationsEinheitRequest(organisationsEinheitRequest, VORGANG_ID)).thenReturn(organisationsEinheitCollaboration); - when(mapper.fromFachstelleRequest(fachstelleRequest, VORGANG_ID)).thenReturn(fachstelleCollaboration); + when(mapper.fromCollaborationRequest(GrpcFindRequestsResponseTestFactory.COLLABORATION_REQUEST)).thenReturn(collaboration); } @Test @@ -58,24 +98,29 @@ class CollaborationRemoteServiceTest { } @Test - void shouldMapOrganisationsEinheitRequest() { + void shouldMapFromCollaborationRequest() { service.getCollaborations(VORGANG_ID).toList(); - verify(mapper).fromOrganisationsEinheitRequest(GrpcFindRequestsResponseTestFactory.ORGANISATIONS_EINHEIT_REQUEST, VORGANG_ID); + verify(mapper).fromCollaborationRequest(GrpcFindRequestsResponseTestFactory.COLLABORATION_REQUEST); } + @Test - void shouldMapFachstelleRequest() { - service.getCollaborations(VORGANG_ID).toList(); + void shouldReturnCollaborations() { + var collaborations = service.getCollaborations(VORGANG_ID).toList(); - verify(mapper).fromFachstelleRequest(GrpcFindRequestsResponseTestFactory.FACHSTELLE_REQUEST, VORGANG_ID); + assertThat(collaborations).containsExactly(collaboration); } + } + + @Nested + class TestBuildGetRequest { @Test - void shouldReturnCollaborations() { - var collaborations = service.getCollaborations(VORGANG_ID).toList(); + void shouldSetCollaborationId() { + var request = service.buildGetRequest(GrpcGetRequestRequestTestFactory.COLLABORATION_ID); - assertThat(collaborations).containsExactlyInAnyOrder(organisationsEinheitCollaboration, fachstelleCollaboration); + assertThat(request.getId()).isEqualTo(GrpcGetRequestRequestTestFactory.COLLABORATION_ID); } } diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationServiceTest.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationServiceTest.java index f2efcfa93d9cf2d49f903e50733133e1f71c8f01..4537ab0f45ee341180e57e22cad4113ec98b92f3 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationServiceTest.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/CollaborationServiceTest.java @@ -19,22 +19,45 @@ class CollaborationServiceTest { @Mock private CollaborationRemoteService remoteService; + @Nested + class TestGetById { + + public static final String COLLABORATION_ID = FachstelleCollaborationTestFactory.ID; + + @Test + void shouldCallRemoteService() { + service.getById(COLLABORATION_ID); + + verify(remoteService).getById(COLLABORATION_ID); + } + + @Test + void shouldReturnCollaboration() { + var expected = FachstelleCollaborationTestFactory.create(); + when(remoteService.getById(COLLABORATION_ID)).thenReturn(expected); + + var collaboration = service.getById(COLLABORATION_ID); + + assertThat(collaboration).isEqualTo(expected); + } + } + @Nested class TestGetCollaborations { - private final String id = UUID.randomUUID().toString(); + private static final String VORGANG_ID = UUID.randomUUID().toString(); @Test void shouldCallRemoteService() { callService(); - verify(remoteService).getCollaborations(id); + verify(remoteService).getCollaborations(VORGANG_ID); } @Test void shouldReturnCollaboration() { var collaboration = FachstelleCollaborationTestFactory.create(); - when(remoteService.getCollaborations(id)).thenReturn(Stream.of(collaboration)); + when(remoteService.getCollaborations(VORGANG_ID)).thenReturn(Stream.of(collaboration)); var returnedCollaboration = callService(); @@ -42,7 +65,7 @@ class CollaborationServiceTest { } private Stream<Collaboration> callService() { - return service.getCollaborations(id); + return service.getCollaborations(VORGANG_ID); } } diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/FachstelleCollaborationTestFactory.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/FachstelleCollaborationTestFactory.java index 4090387d6aa3a6fe593d9a0f3d0e78230e796896..826182491686f8c99fb3b26ea674577db7c3f961 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/FachstelleCollaborationTestFactory.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/FachstelleCollaborationTestFactory.java @@ -9,7 +9,6 @@ import de.ozgcloud.alfa.collaboration.FachstelleCollaboration.FachstelleCollabor public class FachstelleCollaborationTestFactory { public static final String ID = UUID.randomUUID().toString(); - public static final String VORGANG_ID = UUID.randomUUID().toString(); public static final String COLLABORATION_VORGANG_ID = UUID.randomUUID().toString(); public static final long COLLABORATION_LEVEL = 4L; public static final String TITEL = LoremIpsum.getInstance().getWords(7); @@ -24,7 +23,6 @@ public class FachstelleCollaborationTestFactory { private static FachstelleCollaborationBuilder createBuilder() { return FachstelleCollaboration.builder() .id(ID) - .vorgangId(VORGANG_ID) .collaborationVorgangId(COLLABORATION_VORGANG_ID) .collaborationLevel(COLLABORATION_LEVEL) .titel(TITEL) diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcFindRequestsResponseTestFactory.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcFindRequestsResponseTestFactory.java index 96e730a5276df08265625689378559a272fcac0d..b48f634f815b9e249031445f369ff603215cad7a 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcFindRequestsResponseTestFactory.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcFindRequestsResponseTestFactory.java @@ -5,14 +5,13 @@ import de.ozgcloud.collaboration.request.GrpcFindRequestsResponse; class GrpcFindRequestsResponseTestFactory { - public static final GrpcCollaborationRequest ORGANISATIONS_EINHEIT_REQUEST = GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create(); - public static final GrpcCollaborationRequest FACHSTELLE_REQUEST = GrpcCollaborationRequestForFachstelleTestFactory.create(); + public static final GrpcCollaborationRequest COLLABORATION_REQUEST = GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create(); public static GrpcFindRequestsResponse create() { return createBuilder().build(); } public static GrpcFindRequestsResponse.Builder createBuilder() { - return GrpcFindRequestsResponse.newBuilder().addRequests(ORGANISATIONS_EINHEIT_REQUEST).addRequests(FACHSTELLE_REQUEST); + return GrpcFindRequestsResponse.newBuilder().addRequests(COLLABORATION_REQUEST); } } diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestRequestTestFactory.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestRequestTestFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..793f7c1dffd5b8de535daea6a131b2a2ceb8e358 --- /dev/null +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestRequestTestFactory.java @@ -0,0 +1,18 @@ +package de.ozgcloud.alfa.collaboration; + +import java.util.UUID; + +import de.ozgcloud.collaboration.request.GrpcGetRequestRequest; + +class GrpcGetRequestRequestTestFactory { + + public static final String COLLABORATION_ID = UUID.randomUUID().toString(); + + public static GrpcGetRequestRequest create() { + return createBuilder().build(); + } + + public static GrpcGetRequestRequest.Builder createBuilder() { + return GrpcGetRequestRequest.newBuilder().setId(COLLABORATION_ID); + } +} diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestResponseTestFactory.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestResponseTestFactory.java new file mode 100644 index 0000000000000000000000000000000000000000..dff32b134152c7d16f10bff311d72391841e4b76 --- /dev/null +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/GrpcGetRequestResponseTestFactory.java @@ -0,0 +1,17 @@ +package de.ozgcloud.alfa.collaboration; + +import de.ozgcloud.collaboration.request.GrpcCollaborationRequest; +import de.ozgcloud.collaboration.request.GrpcGetRequestResponse; + +class GrpcGetRequestResponseTestFactory { + + public static final GrpcCollaborationRequest COLLABORATION_REQUEST = GrpcCollaborationRequestForOrganisationsEinheitTestFactory.create(); + + public static GrpcGetRequestResponse create() { + return createBuilder().build(); + } + + public static GrpcGetRequestResponse.Builder createBuilder() { + return GrpcGetRequestResponse.newBuilder().setRequest(COLLABORATION_REQUEST); + } +} diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/OrganisationsEinheitCollaborationTestFactory.java b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/OrganisationsEinheitCollaborationTestFactory.java index 29ba6f8f613b0197aaaeac0163fb54572f78aec8..2509c88512190118b8bd3b20de203739ce50402d 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/OrganisationsEinheitCollaborationTestFactory.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/collaboration/OrganisationsEinheitCollaborationTestFactory.java @@ -9,7 +9,6 @@ import de.ozgcloud.alfa.collaboration.OrganisationsEinheitCollaboration.Organisa public class OrganisationsEinheitCollaborationTestFactory { public static final String ID = UUID.randomUUID().toString(); - public static final String VORGANG_ID = UUID.randomUUID().toString(); public static final String COLLABORATION_VORGANG_ID = UUID.randomUUID().toString(); public static final long COLLABORATION_LEVEL = 1L; public static final String TITEL = LoremIpsum.getInstance().getWords(7); @@ -24,7 +23,6 @@ public class OrganisationsEinheitCollaborationTestFactory { private static OrganisationsEinheitCollaborationBuilder createBuilder() { return OrganisationsEinheitCollaboration.builder() .id(ID) - .vorgangId(VORGANG_ID) .collaborationVorgangId(COLLABORATION_VORGANG_ID) .collaborationLevel(COLLABORATION_LEVEL) .titel(TITEL)