diff --git a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/CollaborationEventListener.java b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/CollaborationEventListener.java index cb8abfd8503f06fb6ce2409e826e4c333fd04ddf..d29b34d014c6f45e3c3bed16d874c4a56c80f421 100644 --- a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/CollaborationEventListener.java +++ b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/CollaborationEventListener.java @@ -81,7 +81,7 @@ class CollaborationEventListener { void createLevel1CollaborationRequest(CollaborationRequest collaborationRequest, Command command) { var fachstelle = fachstelleService - .getOrganisationsEinheit((String) command.getBodyObject().get(CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE)); + .getOrganisationEinheit((String) command.getBodyObject().get(CollaborationRequest.PROPERTY_ZUSTAENDIGE_STELLE)); collaborationService.createCollaborationRequest(collaborationRequest.toBuilder().zustaendigeStelle(fachstelle).build()); } diff --git a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/Fachstelle.java b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/Fachstelle.java index 31f8d5c2b123b5083dfdc17f01091fb930b12df5..928ca8d917c1e50325951e9f07dc3b021ebcee13 100644 --- a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/Fachstelle.java +++ b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/Fachstelle.java @@ -22,6 +22,6 @@ public class Fachstelle { private FachstelleType type; public enum FachstelleType { - EXTERNE_FACHSTELLE, ORGANISATIONS_EINHEIT; + EXTERNE_FACHSTELLE, ORGANISATION_EINHEIT; } } diff --git a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapper.java b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapper.java index a7dc28c1b65e3ea1afb6bf34acc880eb739d4bbb..7b3eba32dc945a202aeea5a861482db1d2163657 100644 --- a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapper.java +++ b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapper.java @@ -27,8 +27,8 @@ public interface FachstelleMapper { @Mapping(target = "technicalId", source = "id") @Mapping(target = "subjectId", source = "xzufiId.id") - @Mapping(target = "type", expression = "java(FachstelleType.ORGANISATIONS_EINHEIT)") - Fachstelle fromOrganisationsEinheit(GrpcOrganisationsEinheit organisationsEinheit); + @Mapping(target = "type", expression = "java(FachstelleType.ORGANISATION_EINHEIT)") + Fachstelle fromOrganisationEinheit(GrpcOrganisationsEinheit organisationsEinheit); default Map<String, Object> toMap(Fachstelle fachstelle) { return Map.of( diff --git a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteService.java b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteService.java index f12c8e0da133a569546faddf1c2ec97676e11ef9..b49627ac5bb16ba916243fec990951f4bf33105c 100644 --- a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteService.java +++ b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteService.java @@ -34,11 +34,11 @@ class FachstelleRemoteService { return fachstelleServiceBlockingStub.withInterceptors(callContextInterceptor); } - public Fachstelle getOrganisationsEinheit(String id) { - var organisationsEinheit = getOrganisationsEinheitServiceBlockingStub() + public Fachstelle getOrganisationEinheit(String id) { + var organisationEinheit = getOrganisationsEinheitServiceBlockingStub() .getById(GrpcOrganisationsEinheitGetRequest.newBuilder().setId(id).build()) .getOrganisationsEinheit(); - return fachstelleMapper.fromOrganisationsEinheit(organisationsEinheit); + return fachstelleMapper.fromOrganisationEinheit(organisationEinheit); } public OrganisationsEinheitServiceBlockingStub getOrganisationsEinheitServiceBlockingStub() { diff --git a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleService.java b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleService.java index 1bc8039327c4e29831ccb6e12f2fff821afe4fe2..1651b44170f43d17dca87271b50232b3311eb105 100644 --- a/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleService.java +++ b/collaboration-manager-server/src/main/java/de/ozgcloud/collaboration/fachstelle/FachstelleService.java @@ -10,8 +10,8 @@ public class FachstelleService { private final FachstelleRemoteService remoteService; - public Fachstelle getOrganisationsEinheit(String technicalId) { - return remoteService.getOrganisationsEinheit(technicalId); + public Fachstelle getOrganisationEinheit(String technicalId) { + return remoteService.getOrganisationEinheit(technicalId); } public Fachstelle getExterneFachstelle(String technicalId) { diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/CollaborationEventListenerTest.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/CollaborationEventListenerTest.java index ccd5e1497fb0227f84b9de0cefb82e1a85575c64..253530559fc79232f6200875ac6ae995e77e6087 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/CollaborationEventListenerTest.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/CollaborationEventListenerTest.java @@ -161,12 +161,12 @@ class CollaborationEventListenerTest { void shouldCallFachstelleService() { createLevel1CollaborationRequest(); - verify(fachstelleService).getOrganisationsEinheit(FachstelleTestFactory.TECHNICAL_ID); + verify(fachstelleService).getOrganisationEinheit(FachstelleTestFactory.TECHNICAL_ID); } @Test void shouldCallCreateCollaborationRequest() { - when(fachstelleService.getOrganisationsEinheit(any())).thenReturn(CollaborationRequestTestFactory.ZUSTAENDIGE_STELLE); + when(fachstelleService.getOrganisationEinheit(any())).thenReturn(CollaborationRequestTestFactory.ZUSTAENDIGE_STELLE); createLevel1CollaborationRequest(); diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapperTest.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapperTest.java index 62906be89475ac5a4b6d154306fcd5b7a833cb5e..21a0c986d85fdd4c7eab2ebc4e93f2a2cdee5ceb 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapperTest.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleMapperTest.java @@ -26,13 +26,13 @@ class FachstelleMapperTest { } @Nested - class TestFromOrganisationsEinheit { + class TestFromOrganisationEinheit { @Test void shouldMapToFachstelle() { - var expectedFachstelle = FachstelleTestFactory.createBuilder().type(FachstelleType.ORGANISATIONS_EINHEIT).build(); + var expectedFachstelle = FachstelleTestFactory.createBuilder().type(FachstelleType.ORGANISATION_EINHEIT).build(); - var fachstelle = mapper.fromOrganisationsEinheit(GrpcOrganisationsEinheitTestFactory.create()); + var fachstelle = mapper.fromOrganisationEinheit(GrpcOrganisationsEinheitTestFactory.create()); assertThat(fachstelle).usingRecursiveComparison().isEqualTo(expectedFachstelle); } diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteServiceTest.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteServiceTest.java index 8be0851d6640764d12159c231bbb5a3a7c1e28ed..aabed17d360a95a00a3baeee64328bda1c746eab 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteServiceTest.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleRemoteServiceTest.java @@ -102,7 +102,7 @@ class FachstelleRemoteServiceTest { } @Nested - class TestGetOrganisationsEinheit { + class TestGetOrganisationEinheit { @Mock private OrganisationsEinheitServiceBlockingStub organisationsEinheitServiceBlockingStubWithInterceptor; @@ -116,37 +116,37 @@ class FachstelleRemoteServiceTest { @Test void shouldCallGetOrganisationsEinheitServiceBlockingStub() { - getOrganisationsEinheit(); + getOrganisationEinheit(); verify(service).getOrganisationsEinheitServiceBlockingStub(); } @Test void shouldCallOrganisationsEinheitServiceBlockingStub() { - getOrganisationsEinheit(); + getOrganisationEinheit(); verify(organisationsEinheitServiceBlockingStubWithInterceptor).getById(GrpcOrganisationsEinheitGetRequestTestFactory.create()); } @Test void shouldCallFachstelleMapper() { - getOrganisationsEinheit(); + getOrganisationEinheit(); - verify(fachstelleMapper).fromOrganisationsEinheit(GrpcOrganisationsEinheitGetResponseTestFactory.ORGANISATIONS_EINHEIT); + verify(fachstelleMapper).fromOrganisationEinheit(GrpcOrganisationsEinheitGetResponseTestFactory.ORGANISATION_EINHEIT); } @Test void shouldReturnFachstelle() { var expectedFachstelle = FachstelleTestFactory.create(); - when(fachstelleMapper.fromOrganisationsEinheit(any())).thenReturn(expectedFachstelle); + when(fachstelleMapper.fromOrganisationEinheit(any())).thenReturn(expectedFachstelle); - var returnFachstelle = getOrganisationsEinheit(); + var returnFachstelle = getOrganisationEinheit(); assertThat(returnFachstelle).isSameAs(expectedFachstelle); } - private Fachstelle getOrganisationsEinheit() { - return service.getOrganisationsEinheit(FachstelleTestFactory.TECHNICAL_ID); + private Fachstelle getOrganisationEinheit() { + return service.getOrganisationEinheit(FachstelleTestFactory.TECHNICAL_ID); } } diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleServiceTest.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleServiceTest.java index 943a384472dd4ebd62869a87051d00436faa8a8e..7447ac42fc64533f349340c17243bb8929512406 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleServiceTest.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleServiceTest.java @@ -18,21 +18,21 @@ class FachstelleServiceTest { private FachstelleRemoteService remoteService; @Nested - class TestGetOrganisationsEinheit { + class TestGetOrganisationEinheit { @Test - void shouldGetOrganisationsEinheit() { - service.getOrganisationsEinheit(FachstelleTestFactory.TECHNICAL_ID); + void shouldGetOrganisationEinheit() { + service.getOrganisationEinheit(FachstelleTestFactory.TECHNICAL_ID); - verify(remoteService).getOrganisationsEinheit(FachstelleTestFactory.TECHNICAL_ID); + verify(remoteService).getOrganisationEinheit(FachstelleTestFactory.TECHNICAL_ID); } @Test void shouldReturnFachstelle() { var expectedFachstelle = FachstelleTestFactory.create(); - when(remoteService.getOrganisationsEinheit(any())).thenReturn(expectedFachstelle); + when(remoteService.getOrganisationEinheit(any())).thenReturn(expectedFachstelle); - var actualFachstelle = service.getOrganisationsEinheit(FachstelleTestFactory.TECHNICAL_ID); + var actualFachstelle = service.getOrganisationEinheit(FachstelleTestFactory.TECHNICAL_ID); assertThat(actualFachstelle).isSameAs(expectedFachstelle); } diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleTestFactory.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleTestFactory.java index dce9ce074324f9f4f68705f4c91f65ee84125514..4376385b28a4cdd1464bdb3ddfbb057255fb0b6c 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleTestFactory.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/FachstelleTestFactory.java @@ -8,7 +8,7 @@ import de.ozgcloud.collaboration.fachstelle.Fachstelle.FachstelleType; public class FachstelleTestFactory { - public static final FachstelleType TYPE = FachstelleType.ORGANISATIONS_EINHEIT; + public static final FachstelleType TYPE = FachstelleType.ORGANISATION_EINHEIT; public static final String SUBJECT_ID = UUID.randomUUID().toString(); public static final String TECHNICAL_ID = UUID.randomUUID().toString(); diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcOrganisationsEinheitGetResponseTestFactory.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcOrganisationsEinheitGetResponseTestFactory.java index 823e7eb8794e3c31986ed1ead5dee96f835992d8..238046f6d34d78e1ced02c1e306e0276583a6ebb 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcOrganisationsEinheitGetResponseTestFactory.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcOrganisationsEinheitGetResponseTestFactory.java @@ -6,14 +6,14 @@ import de.ozgcloud.zufi.grpc.organisationseinheit.GrpcOrganisationsEinheitGetRes public class GrpcOrganisationsEinheitGetResponseTestFactory { - public static final GrpcOrganisationsEinheit ORGANISATIONS_EINHEIT = GrpcOrganisationsEinheitTestFactory.create(); + public static final GrpcOrganisationsEinheit ORGANISATION_EINHEIT = GrpcOrganisationsEinheitTestFactory.create(); public static GrpcOrganisationsEinheitGetResponse create() { return createBuilder().build(); } public static Builder createBuilder() { - return GrpcOrganisationsEinheitGetResponse.newBuilder().setOrganisationsEinheit(ORGANISATIONS_EINHEIT); + return GrpcOrganisationsEinheitGetResponse.newBuilder().setOrganisationsEinheit(ORGANISATION_EINHEIT); } } diff --git a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcXzufiIdTestFactory.java b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcXzufiIdTestFactory.java index a9459580db55559cbac4117474f8512c756627ad..7db7a81ee16567fcf452b73a27c4f9127ce96dda 100644 --- a/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcXzufiIdTestFactory.java +++ b/collaboration-manager-server/src/test/java/de/ozgcloud/collaboration/fachstelle/GrpcXzufiIdTestFactory.java @@ -29,7 +29,7 @@ import de.ozgcloud.zufi.grpc.organisationseinheit.GrpcXzufiId; import de.ozgcloud.zufi.grpc.organisationseinheit.GrpcXzufiId.Builder; public class GrpcXzufiIdTestFactory { - public static final String ORGANISATIONS_EINHEIT_ID = FachstelleTestFactory.SUBJECT_ID; + public static final String ORGANISATION_EINHEIT_ID = FachstelleTestFactory.SUBJECT_ID; public static final String SCHEME_AGENCY_ID = UUID.randomUUID().toString(); public static GrpcXzufiId create() { @@ -37,6 +37,6 @@ public class GrpcXzufiIdTestFactory { } public static Builder createBuilder() { - return GrpcXzufiId.newBuilder().setId(ORGANISATIONS_EINHEIT_ID).setSchemeAgencyId(SCHEME_AGENCY_ID); + return GrpcXzufiId.newBuilder().setId(ORGANISATION_EINHEIT_ID).setSchemeAgencyId(SCHEME_AGENCY_ID); } }