Merge branch 'RED-6903' into 'main'

RED-6903 - Adjust failure message to allow different username and from email

See merge request fforesight/tenant-user-management-service!39
This commit is contained in:
Kilian Schüttler 2023-09-20 11:18:54 +02:00
commit 1508c8fad4
2 changed files with 0 additions and 16 deletions

View File

@ -57,9 +57,6 @@ public class EmailService {
if (auth) {
props.setProperty("mail.smtp.auth", "true");
if (!config.get("user").equals(address)) {
throw new BadRequestException("User and from email should be the same");
}
}
if (ssl) {

View File

@ -55,19 +55,6 @@ public class SMTPConfigurationTest extends AbstractTenantUserManagementIntegrati
TenantContext.clear();
}
@Test
public void testSMTPConnectionWithDifferentEmails() {
TenantContext.setTenantId(AbstractTenantUserManagementIntegrationTest.TEST_TENANT_ID);
SMTPConfiguration smtpConfiguration = provideTestSMTPConfiguration();
smtpConfiguration.setUser("invalid");
assertThatThrownBy(() -> smtpConfigurationClient.testSMTPConfiguration(smtpConfiguration)).hasMessageContaining("User and from email should be the same");
TenantContext.clear();
}
private SMTPConfiguration provideTestSMTPConfiguration() {
SMTPConfiguration smtpConfiguration = new SMTPConfiguration();