@Test
	void testAbortedMailTransaction() throws Exception {
		when(messageHandlerFactory.create(any(MessageContext.class))).thenReturn(messageHandler);

		final SmartClient client = new SmartClient("localhost", smtpServer.getPort(), "localhost");
		client.from("john@example.com");
		client.quit();
		smtpServer.stop(); // wait for the server to catch up

		verify(messageHandlerFactory).create(any(MessageContext.class));
		verify(messageHandler).from(anyString());
		verify(messageHandler).done();
		verifyNoMoreInteractions(messageHandlerFactory, messageHandler, messageHandler2);
	}
This class tests whether the event handler methods defined in MessageHandler
are called at the appropriate times and in good order.
src/test/java/de/gessnerfl/fakesmtp/smtp/server/MessageHandlerTest.java