Skip to content
Snippets Groups Projects
Commit 624c15bf authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6574 ignore case for service konto type comparison

parent 618a07c0
Branches
Tags
No related merge requests found
...@@ -161,7 +161,7 @@ class PostfachMailService { ...@@ -161,7 +161,7 @@ class PostfachMailService {
} }
return postfachConfigGroup.getPostfachConfigs().stream() return postfachConfigGroup.getPostfachConfigs().stream()
.filter(postfachConfig -> postfachConfig.getType().equals(serviceKontoType)) .filter(postfachConfig -> postfachConfig.getType().equalsIgnoreCase(serviceKontoType))
.map(PostfachConfig::isReplyAllowed) .map(PostfachConfig::isReplyAllowed)
.findFirst() .findFirst()
.orElse(false); .orElse(false);
......
...@@ -556,7 +556,7 @@ class PostfachMailServiceTest { ...@@ -556,7 +556,7 @@ class PostfachMailServiceTest {
} }
@Test @Test
@DisplayName("reply not allowed for given ServiceKonto-type") @DisplayName("reply not allowed if postfach not configured")
void shouldReturnFalseIfPostfachNotConfigured() { void shouldReturnFalseIfPostfachNotConfigured() {
setPostfachConfigGroup(PostfachConfigGroupTestFactory.createBuilder().postfachConfigs(List.of()).build()); setPostfachConfigGroup(PostfachConfigGroupTestFactory.createBuilder().postfachConfigs(List.of()).build());
doReturn(false).when(service).isPostfachConfigured(); doReturn(false).when(service).isPostfachConfigured();
...@@ -612,6 +612,17 @@ class PostfachMailServiceTest { ...@@ -612,6 +612,17 @@ class PostfachMailServiceTest {
assertThat(replyAllowed).isTrue(); assertThat(replyAllowed).isTrue();
} }
@Test
@DisplayName("reply allowed for given lower case ServiceKonto-type")
void shouldReturnTrueIfReplyIsAllowedForLowerCaseServiceKontoType() {
setPostfachConfigGroup(PostfachConfigGroupTestFactory.create());
doReturn(true).when(service).isPostfachConfigured();
var replyAllowed = service.isReplyAllowed(PostfachConfigTestFactory.TYPE.toLowerCase());
assertThat(replyAllowed).isTrue();
}
@Test @Test
void shouldReturnTrueIfAlwaysAllowed() { void shouldReturnTrueIfAlwaysAllowed() {
when(featureToggleProperties.isReplyAlwaysAllowed()).thenReturn(true); when(featureToggleProperties.isReplyAlwaysAllowed()).thenReturn(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment