diff --git a/alfa-service/src/main/java/de/ozgcloud/alfa/postfach/PostfachMailService.java b/alfa-service/src/main/java/de/ozgcloud/alfa/postfach/PostfachMailService.java index 732530317ed1c1140ac3e702bb0c51b38d528cea..17c5a69936b94b265c1eaf802fcc4f49802aca91 100644 --- a/alfa-service/src/main/java/de/ozgcloud/alfa/postfach/PostfachMailService.java +++ b/alfa-service/src/main/java/de/ozgcloud/alfa/postfach/PostfachMailService.java @@ -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); diff --git a/alfa-service/src/test/java/de/ozgcloud/alfa/postfach/PostfachMailServiceTest.java b/alfa-service/src/test/java/de/ozgcloud/alfa/postfach/PostfachMailServiceTest.java index 85c964af5fddcf578e6074bec1c596245b121d0b..f31e143f6a0b1723b19a82771fced255d102340f 100644 --- a/alfa-service/src/test/java/de/ozgcloud/alfa/postfach/PostfachMailServiceTest.java +++ b/alfa-service/src/test/java/de/ozgcloud/alfa/postfach/PostfachMailServiceTest.java @@ -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);