Skip to content
Snippets Groups Projects
Commit b3050d36 authored by Krzysztof Witukiewicz's avatar Krzysztof Witukiewicz
Browse files

OZG-7526 OZG-7527 Remove organisationsEinheitSettings from PostfachProperties

parent 0bf059ad
Branches
Tags
1 merge request!8OZG-7526 OZG-7527 Signatur nur aus Postfach lesen
...@@ -23,8 +23,6 @@ ...@@ -23,8 +23,6 @@
*/ */
package de.ozgcloud.alfa.postfach; package de.ozgcloud.alfa.postfach;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope; import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
...@@ -46,9 +44,4 @@ public class PostfachProperties { ...@@ -46,9 +44,4 @@ public class PostfachProperties {
*/ */
private String signatur = ""; private String signatur = "";
/**
* Settings that are linked to an Organisationseinheit. Configured by administration config server.
*/
private Map<String, Map<String, Object>> organisationsEinheitSettings = Map.of();
} }
...@@ -34,15 +34,13 @@ import org.springframework.test.context.TestPropertySource; ...@@ -34,15 +34,13 @@ import org.springframework.test.context.TestPropertySource;
@SpringBootTest(classes = { PostfachPropertiesTestConfiguration.class }) @SpringBootTest(classes = { PostfachPropertiesTestConfiguration.class })
class PostfachPropertiesTest { class PostfachPropertiesTest {
private static final String ORGANISATIONSEINHEITEN_ID = "oe1";
private static final String TEST_SIG = "test1"; private static final String TEST_SIG = "test1";
private static final String TEST_ORGANISATIONS_SIG = OrganisationsEinheitSettingsTestFactory.TEST_SIGNATUR;
@DisplayName("Test loading postfach configuration") @DisplayName("Test loading postfach configuration")
@Nested @Nested
@TestPropertySource(properties = { @TestPropertySource(properties = {
PostfachProperties.PREFIX + ".signatur=" + TEST_SIG, PostfachProperties.PREFIX + ".signatur=" + TEST_SIG
PostfachProperties.PREFIX + ".organisations-einheit-settings." + ORGANISATIONSEINHEITEN_ID + ".signatur=" + TEST_ORGANISATIONS_SIG,
}) })
class TestLoadingPostfachProperties { class TestLoadingPostfachProperties {
...@@ -58,34 +56,9 @@ class PostfachPropertiesTest { ...@@ -58,34 +56,9 @@ class PostfachPropertiesTest {
} }
@Test @Test
void shouldHaveOrganisationsEinheitSettings() { void shouldHaveSignatur() {
assertThat(postfachProperties.getOrganisationsEinheitSettings()).isNotNull(); assertThat(postfachProperties.getSignatur()).isEqualTo(TEST_SIG);
}
}
}
@DisplayName("Test mapping organisations einheit settings")
@Nested
@TestPropertySource(properties = {
PostfachProperties.PREFIX + ".signatur=" + TEST_SIG,
PostfachProperties.PREFIX + ".organisations-einheit-settings.oe1.signatur=" + TEST_ORGANISATIONS_SIG,
})
class TestMapOrganisationsEinheitSettings {
@Autowired
private PostfachProperties postfachProperties;
@Test
void shouldHaveOrganisationsEinheit() {
var props = postfachProperties.getOrganisationsEinheitSettings();
assertThat(props).containsKey(ORGANISATIONSEINHEITEN_ID);
} }
@Test
void shouldHaveOrganisationsEinheitSetting() {
assertThat(postfachProperties.getOrganisationsEinheitSettings().get(ORGANISATIONSEINHEITEN_ID)).hasFieldOrPropertyWithValue("signatur",
TEST_ORGANISATIONS_SIG);
} }
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment