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:
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:
......
......@@ -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;
}
......@@ -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);
}
}
......@@ -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:
......
/*
* 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 {
......
......@@ -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();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment