Skip to content
Snippets Groups Projects
Commit 6d990407 authored by OZGCloud's avatar OZGCloud
Browse files

Merge pull request 'OZG-6574 ignore case for service konto type comparison'...

Merge pull request 'OZG-6574 ignore case for service konto type comparison' (#746) from OZG-6574-ignore-case-for-service-konto-type into master

Reviewed-on: https://git.ozg-sh.de/ozgcloud-app/alfa/pulls/746


Reviewed-by: default avatarOZGCloud <ozgcloud@mgm-tp.com>
parents 618a07c0 624c15bf
No related branches found
No related tags found
No related merge requests found
......@@ -161,7 +161,7 @@ class PostfachMailService {
}
return postfachConfigGroup.getPostfachConfigs().stream()
.filter(postfachConfig -> postfachConfig.getType().equals(serviceKontoType))
.filter(postfachConfig -> postfachConfig.getType().equalsIgnoreCase(serviceKontoType))
.map(PostfachConfig::isReplyAllowed)
.findFirst()
.orElse(false);
......
......@@ -556,7 +556,7 @@ class PostfachMailServiceTest {
}
@Test
@DisplayName("reply not allowed for given ServiceKonto-type")
@DisplayName("reply not allowed if postfach not configured")
void shouldReturnFalseIfPostfachNotConfigured() {
setPostfachConfigGroup(PostfachConfigGroupTestFactory.createBuilder().postfachConfigs(List.of()).build());
doReturn(false).when(service).isPostfachConfigured();
......@@ -612,6 +612,17 @@ class PostfachMailServiceTest {
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
void shouldReturnTrueIfAlwaysAllowed() {
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