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

OZG-7526 OZG-7527 Remove organisationsEinheitSettings from PostfachProperties

parent 30073d1a
No related branches found
No related tags found
1 merge request!9Ozg 7526 signatur bug kein hotfix
......@@ -23,8 +23,6 @@
*/
package de.ozgcloud.alfa.postfach;
import java.util.Map;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;
......@@ -46,9 +44,4 @@ public class PostfachProperties {
*/
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;
@SpringBootTest(classes = { PostfachPropertiesTestConfiguration.class })
class PostfachPropertiesTest {
private static final String ORGANISATIONSEINHEITEN_ID = "oe1";
private static final String TEST_SIG = "test1";
private static final String TEST_ORGANISATIONS_SIG = OrganisationsEinheitSettingsTestFactory.TEST_SIGNATUR;
@DisplayName("Test loading postfach configuration")
@Nested
@TestPropertySource(properties = {
PostfachProperties.PREFIX + ".signatur=" + TEST_SIG,
PostfachProperties.PREFIX + ".organisations-einheit-settings." + ORGANISATIONSEINHEITEN_ID + ".signatur=" + TEST_ORGANISATIONS_SIG,
PostfachProperties.PREFIX + ".signatur=" + TEST_SIG
})
class TestLoadingPostfachProperties {
......@@ -58,34 +56,9 @@ class PostfachPropertiesTest {
}
@Test
void shouldHaveOrganisationsEinheitSettings() {
assertThat(postfachProperties.getOrganisationsEinheitSettings()).isNotNull();
}
}
}
@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);
void shouldHaveSignatur() {
assertThat(postfachProperties.getSignatur()).isEqualTo(TEST_SIG);
}
@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