use of org.subethamail.smtp.server.SMTPServer in project fake-smtp-server by gessnerfl.
the class SmtpServerConfiguratorTest method shouldSkipConfigurationOfAuthenticationWhenPasswordIsEmptyString.
@Test
public void shouldSkipConfigurationOfAuthenticationWhenPasswordIsEmptyString() {
final String username = "username";
final FakeSmtpConfigurationProperties.Authentication authentication = mock(FakeSmtpConfigurationProperties.Authentication.class);
when(authentication.getUsername()).thenReturn(username);
when(authentication.getPassword()).thenReturn("");
when(fakeSmtpConfigurationProperties.getAuthentication()).thenReturn(authentication);
final SMTPServer smtpServer = mock(SMTPServer.class);
sut.configure(smtpServer);
verify(smtpServer, never()).setAuthenticationHandlerFactory(any(AuthenticationHandlerFactory.class));
verify(logger).error(startsWith("Password"));
}
use of org.subethamail.smtp.server.SMTPServer in project fake-smtp-server by gessnerfl.
the class SmtpServerConfiguratorTest method shouldSkipConfigurationOfAuthenticationWhenUsernameIsEmptyString.
@Test
public void shouldSkipConfigurationOfAuthenticationWhenUsernameIsEmptyString() {
final FakeSmtpConfigurationProperties.Authentication authentication = mock(FakeSmtpConfigurationProperties.Authentication.class);
when(authentication.getUsername()).thenReturn("");
when(fakeSmtpConfigurationProperties.getAuthentication()).thenReturn(authentication);
final SMTPServer smtpServer = mock(SMTPServer.class);
sut.configure(smtpServer);
verify(smtpServer, never()).setAuthenticationHandlerFactory(any(AuthenticationHandlerFactory.class));
verify(logger).error(startsWith("Username"));
}
use of org.subethamail.smtp.server.SMTPServer in project fake-smtp-server by gessnerfl.
the class SmtpServerImplTest method shouldCreateNewInstanceAndDelegateCallsToRealImplementation.
@Test
public void shouldCreateNewInstanceAndDelegateCallsToRealImplementation() {
SMTPServer delegate = mock(SMTPServer.class);
SmtpServerImpl sut = new SmtpServerImpl(delegate);
sut.start();
verify(delegate).start();
sut.stop();
verify(delegate).stop();
}
Aggregations