From 416c9304b6f1aa719fc427bbd1a27a799d7f6b5e Mon Sep 17 00:00:00 2001 From: OZGCloud <ozgcloud@mgm-tp.com> Date: Wed, 18 Dec 2024 17:25:04 +0100 Subject: [PATCH] OZG-7350 rename organisationsEinheit --> organisationEinheit except in grpc --- .../CollaborationEventListener.java | 2 +- .../collaboration/fachstelle/Fachstelle.java | 2 +- .../fachstelle/FachstelleMapper.java | 4 ++-- .../fachstelle/FachstelleRemoteService.java | 6 +++--- .../fachstelle/FachstelleService.java | 4 ++-- .../CollaborationEventListenerTest.java | 4 ++-- .../fachstelle/FachstelleMapperTest.java | 6 +++--- .../FachstelleRemoteServiceTest.java | 18 +++++++++--------- .../fachstelle/FachstelleServiceTest.java | 12 ++++++------ .../fachstelle/FachstelleTestFactory.java | 2 +- ...nisationsEinheitGetResponseTestFactory.java | 4 ++-- .../fachstelle/GrpcXzufiIdTestFactory.java | 4 ++-- 12 files changed, 34 insertions(+), 34 deletions(-) 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 cb8abfd..d29b34d 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 31f8d5c..928ca8d 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 a7dc28c..7b3eba3 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 f12c8e0..b49627a 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 1bc8039..1651b44 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 ccd5e14..2535305 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 62906be..21a0c98 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 8be0851..aabed17 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 943a384..7447ac4 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 dce9ce0..4376385 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 823e7eb..238046f 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 a945958..7db7a81 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); } } -- GitLab