Skip to content
Snippets Groups Projects
Commit 82e6b20f authored by Felix Reichenbach's avatar Felix Reichenbach
Browse files

OZG-6741 apply code review comments

parent 6ba4d3f2
No related branches found
No related tags found
1 merge request!1Ozg 6741 organisationseinheit link
...@@ -124,7 +124,7 @@ spec: ...@@ -124,7 +124,7 @@ spec:
value: {{ .Values.ozgcloud.feature.organisationsEinheiten | quote }} value: {{ .Values.ozgcloud.feature.organisationsEinheiten | quote }}
{{- end }} {{- end }}
{{- if eq ((.Values.ozgcloud).feature).organisationsEinheiten "true" }} {{- 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}} value: {{ required "ozgcloud.organisationsEinheit.zufiSearchUri must be set if feature organisationsEinheiten is activated" ((.Values.ozgcloud).organisationsEinheit).zufiSearchUri}}
{{- end }} {{- end }}
envFrom: envFrom:
......
...@@ -42,6 +42,10 @@ class OrganisationsEinheitProperties { ...@@ -42,6 +42,10 @@ class OrganisationsEinheitProperties {
static final String ORGANISATIONS_EINHEIT_PROPERTIES_PREFIX = "ozgcloud.organisations-einheit"; static final String ORGANISATIONS_EINHEIT_PROPERTIES_PREFIX = "ozgcloud.organisations-einheit";
/*
* Uri pointing to the endpoint in Alfa that searches for Organisationseinheiten
* in Zufi
*/
@NotBlank @NotBlank
private String zufiSucheUri; private String zufiSearchUri;
} }
...@@ -61,6 +61,6 @@ class OrganisationsEinheitRootProcessor implements RepresentationModelProcessor< ...@@ -61,6 +61,6 @@ class OrganisationsEinheitRootProcessor implements RepresentationModelProcessor<
} }
private Link buildSearchOrganisationsEinheitLink() { private Link buildSearchOrganisationsEinheitLink() {
return Link.of(organisationsEinheitProperties.getZufiSucheUri(), REL_SEARCH_ORGANISATIONS_EINHEIT); return Link.of(organisationsEinheitProperties.getZufiSearchUri(), REL_SEARCH_ORGANISATIONS_EINHEIT);
} }
} }
...@@ -47,7 +47,7 @@ tests: ...@@ -47,7 +47,7 @@ tests:
- notContains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_organisationseinheit_zufisucheuri name: ozgcloud_organisationseinheit_zufisearchuri
any: true any: true
- it: should not contain zufi search uri if organisationseinheit feature toggle is disabled - it: should not contain zufi search uri if organisationseinheit feature toggle is disabled
set: set:
...@@ -58,7 +58,7 @@ tests: ...@@ -58,7 +58,7 @@ tests:
- notContains: - notContains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_organisationseinheit_zufisucheuri name: ozgcloud_organisationseinheit_zufisearchuri
any: true any: true
- it: should set zufi search uri - it: should set zufi search uri
set: set:
...@@ -71,7 +71,7 @@ tests: ...@@ -71,7 +71,7 @@ tests:
- contains: - contains:
path: spec.template.spec.containers[0].env path: spec.template.spec.containers[0].env
content: content:
name: ozgcloud_organisationseinheit_zufisucheuri name: ozgcloud_organisationseinheit_zufisearchuri
value: alfa/zufi/search/endpoint?searchBy={searchBy} value: alfa/zufi/search/endpoint?searchBy={searchBy}
- it: should fail if zufi search uri is not set - it: should fail if zufi search uri is not set
set: set:
......
/* /*
* 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 * Ministerpräsidenten des Landes Schleswig-Holstein
* Staatskanzlei * Staatskanzlei
* Abteilung Digitalisierung und zentrales IT-Management der Landesregierung * Abteilung Digitalisierung und zentrales IT-Management der Landesregierung
...@@ -39,7 +39,7 @@ class OrganisationsEinheitRootProcessorITCase { ...@@ -39,7 +39,7 @@ class OrganisationsEinheitRootProcessorITCase {
@Nested @Nested
@SpringBootTest(properties = { @SpringBootTest(properties = {
"ozgcloud.feature.organisations-einheiten=true", "ozgcloud.feature.organisations-einheiten=true",
"ozgcloud.organisations-einheit.zufi-suche-url=foo" "ozgcloud.organisations-einheit.zufi-search-url=foo"
}) })
@ITCase @ITCase
class TestFeatureEnabled { class TestFeatureEnabled {
...@@ -56,7 +56,7 @@ class OrganisationsEinheitRootProcessorITCase { ...@@ -56,7 +56,7 @@ class OrganisationsEinheitRootProcessorITCase {
@Nested @Nested
@SpringBootTest(properties = { @SpringBootTest(properties = {
"ozgcloud.feature.organisations-einheiten=false", "ozgcloud.feature.organisations-einheiten=false",
"ozgcloud.organisations-einheit.zufi-suche-url=foo" "ozgcloud.organisations-einheit.zufi-search-url=foo"
}) })
@ITCase @ITCase
class TestFeatureDisabled { class TestFeatureDisabled {
......
...@@ -85,11 +85,11 @@ class OrganisationsEinheitRootProcessorTest { ...@@ -85,11 +85,11 @@ class OrganisationsEinheitRootProcessorTest {
@BeforeEach @BeforeEach
void givenHasAdminRole() { void givenHasAdminRole() {
when(currentUserService.hasRole(anyString())).thenReturn(true); when(currentUserService.hasRole(anyString())).thenReturn(true);
when(organisationsEinheitProperties.getZufiSucheUri()).thenReturn(zufiSucheUri); when(organisationsEinheitProperties.getZufiSearchUri()).thenReturn(zufiSucheUri);
} }
@Nested @Nested
class OrganisationsEinheitenLinkRelation { class TestOrganisationsEinheitenLinkRelation {
@Test @Test
void shouldExist() { void shouldExist() {
...@@ -110,7 +110,7 @@ class OrganisationsEinheitRootProcessorTest { ...@@ -110,7 +110,7 @@ class OrganisationsEinheitRootProcessorTest {
} }
@Nested @Nested
class SearchOrganisationsEinheitenLink { class TestSearchOrganisationsEinheitenLink {
@Test @Test
void shouldExistsIfFeatureEnabled() { void shouldExistsIfFeatureEnabled() {
...@@ -123,7 +123,7 @@ class OrganisationsEinheitRootProcessorTest { ...@@ -123,7 +123,7 @@ class OrganisationsEinheitRootProcessorTest {
void shouldGetZufiSucheUri() { void shouldGetZufiSucheUri() {
processModel(); processModel();
verify(organisationsEinheitProperties).getZufiSucheUri(); verify(organisationsEinheitProperties).getZufiSearchUri();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment