diff --git a/src/main/helm/templates/deployment.yaml b/src/main/helm/templates/deployment.yaml index 79e17f064c77f89746fe128491b9a2f406405d9a..6fd4107515b07e7a6e6197e0bae9ff07b25db063 100644 --- a/src/main/helm/templates/deployment.yaml +++ b/src/main/helm/templates/deployment.yaml @@ -124,7 +124,7 @@ spec: value: {{ .Values.ozgcloud.feature.organisationsEinheiten | quote }} {{- end }} {{- if eq ((.Values.ozgcloud).feature).organisationsEinheiten "true" }} - - name: ozgcloud_organisationseinheit_zufisucheuri + - name: ozgcloud_organisationseinheit_zufisearchuri value: {{ required "ozgcloud.organisationsEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated" ((.Values.ozgcloud).organisationsEinheit).zufiSearchUri}} {{- end }} envFrom: diff --git a/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitProperties.java b/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitProperties.java index 95af01fb0a73bcd8c90a9c006b11f345501e46d8..cda6c085bbff016788b37a9e3077bb99507e9585 100644 --- a/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitProperties.java +++ b/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitProperties.java @@ -42,6 +42,10 @@ class OrganisationsEinheitProperties { static final String ORGANISATIONS_EINHEIT_PROPERTIES_PREFIX = "ozgcloud.organisations-einheit"; + /* + * Uri pointing to the endpoint in Alfa that searches for Organisationseinheiten + * in Zufi + */ @NotBlank - private String zufiSucheUri; + private String zufiSearchUri; } diff --git a/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessor.java b/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessor.java index 34caabc64c3920bf6ef76db95a352c5fad6eca77..6265c9696839540ba2d4c3fd9f8b954bd9732027 100644 --- a/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessor.java +++ b/src/main/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessor.java @@ -61,6 +61,6 @@ class OrganisationsEinheitRootProcessor implements RepresentationModelProcessor< } private Link buildSearchOrganisationsEinheitLink() { - return Link.of(organisationsEinheitProperties.getZufiSucheUri(), REL_SEARCH_ORGANISATIONS_EINHEIT); + return Link.of(organisationsEinheitProperties.getZufiSearchUri(), REL_SEARCH_ORGANISATIONS_EINHEIT); } } diff --git a/src/test/helm/deployment_zufi_test.yaml b/src/test/helm/deployment_zufi_test.yaml index eef7e755102bde7b3fed5717cf01e84319053eb0..58c8f7a41723ea089fa5e1156ba0a04f92ad0212 100644 --- a/src/test/helm/deployment_zufi_test.yaml +++ b/src/test/helm/deployment_zufi_test.yaml @@ -47,7 +47,7 @@ tests: - notContains: path: spec.template.spec.containers[0].env content: - name: ozgcloud_organisationseinheit_zufisucheuri + name: ozgcloud_organisationseinheit_zufisearchuri any: true - it: should not contain zufi search uri if organisationseinheit feature toggle is disabled set: @@ -58,7 +58,7 @@ tests: - notContains: path: spec.template.spec.containers[0].env content: - name: ozgcloud_organisationseinheit_zufisucheuri + name: ozgcloud_organisationseinheit_zufisearchuri any: true - it: should set zufi search uri set: @@ -71,7 +71,7 @@ tests: - contains: path: spec.template.spec.containers[0].env content: - name: ozgcloud_organisationseinheit_zufisucheuri + name: ozgcloud_organisationseinheit_zufisearchuri value: alfa/zufi/search/endpoint?searchBy={searchBy} - it: should fail if zufi search uri is not set set: diff --git a/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorITCase.java b/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorITCase.java index 6e1d8b476ab6f573692db10d74425405dd3b1d73..a36223d955c5d6a3663948c515fdb660a6a220dc 100644 --- a/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorITCase.java +++ b/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorITCase.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2024 Das Land Schleswig-Holstein vertreten durch den + * Copyright (C) 2025 Das Land Schleswig-Holstein vertreten durch den * Ministerpräsidenten des Landes Schleswig-Holstein * Staatskanzlei * Abteilung Digitalisierung und zentrales IT-Management der Landesregierung @@ -39,7 +39,7 @@ class OrganisationsEinheitRootProcessorITCase { @Nested @SpringBootTest(properties = { "ozgcloud.feature.organisations-einheiten=true", - "ozgcloud.organisations-einheit.zufi-suche-url=foo" + "ozgcloud.organisations-einheit.zufi-search-url=foo" }) @ITCase class TestFeatureEnabled { @@ -56,7 +56,7 @@ class OrganisationsEinheitRootProcessorITCase { @Nested @SpringBootTest(properties = { "ozgcloud.feature.organisations-einheiten=false", - "ozgcloud.organisations-einheit.zufi-suche-url=foo" + "ozgcloud.organisations-einheit.zufi-search-url=foo" }) @ITCase class TestFeatureDisabled { diff --git a/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorTest.java b/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorTest.java index 3e1df1759dccac5b16e618d14bed5abc6a6d7e52..93a4bbb23853131ddb6e3e643492877d0ada27b7 100644 --- a/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorTest.java +++ b/src/test/java/de/ozgcloud/admin/organisationseinheit/OrganisationsEinheitRootProcessorTest.java @@ -85,11 +85,11 @@ class OrganisationsEinheitRootProcessorTest { @BeforeEach void givenHasAdminRole() { when(currentUserService.hasRole(anyString())).thenReturn(true); - when(organisationsEinheitProperties.getZufiSucheUri()).thenReturn(zufiSucheUri); + when(organisationsEinheitProperties.getZufiSearchUri()).thenReturn(zufiSucheUri); } @Nested - class OrganisationsEinheitenLinkRelation { + class TestOrganisationsEinheitenLinkRelation { @Test void shouldExist() { @@ -110,7 +110,7 @@ class OrganisationsEinheitRootProcessorTest { } @Nested - class SearchOrganisationsEinheitenLink { + class TestSearchOrganisationsEinheitenLink { @Test void shouldExistsIfFeatureEnabled() { @@ -123,7 +123,7 @@ class OrganisationsEinheitRootProcessorTest { void shouldGetZufiSucheUri() { processModel(); - verify(organisationsEinheitProperties).getZufiSucheUri(); + verify(organisationsEinheitProperties).getZufiSearchUri(); }