Response srcResponse = new Response(500, ENHANCED_EXAMPLE);
MailSystemStatus basicResponse =
new ResponseParser()
.createResponseLookingForEnhancedStatusCode(srcResponse);
assertThat(basicResponse, instanceOf(EnhancedStatus.class));
EnhancedStatus enhancedResponse = (EnhancedStatus) basicResponse;
assertEquals("5.7.1", enhancedResponse.getEnhancedStatusCode());
assertEquals("Delivery not authorized, message refused",
enhancedResponse.getMessage());
assertEquals(500, enhancedResponse.getSmtpReplyCode());
}