RED-6903 - Adjust failure message to allow different username and from email
This commit is contained in:
parent
979e9069fa
commit
6fbfbb17ce
@ -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) {
|
||||
|
||||
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user