Search in sources :

Example 6 with SendEmailRequest

use of com.hack23.cia.service.api.action.admin.SendEmailRequest in project cia by Hack23.

the class SendEmailServiceITest method sendEmailInvalidEmailFailureTest.

/**
 * Send email invalid email failure test.
 *
 * @throws Exception
 *             the exception
 */
@Test
public void sendEmailInvalidEmailFailureTest() throws Exception {
    final CreateApplicationSessionRequest createSessionRequest = createTestApplicationSession();
    final SendEmailRequest serviceRequest = new SendEmailRequest();
    serviceRequest.setSessionId(createSessionRequest.getSessionId());
    serviceRequest.setEmail("novalidemail$###hack23.com");
    serviceRequest.setSubject("Test Email SendEmailServiceITest");
    serviceRequest.setContent("Test content");
    final SendEmailResponse response = (SendEmailResponse) applicationManager.service(serviceRequest);
    assertNotNull(EXPECT_A_RESULT, response);
    assertEquals(ServiceResult.FAILURE, response.getResult());
    assertEquals("email must be a well-formed email address", response.getErrorMessage());
}
Also used : SendEmailResponse(com.hack23.cia.service.api.action.admin.SendEmailResponse) CreateApplicationSessionRequest(com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest) SendEmailRequest(com.hack23.cia.service.api.action.admin.SendEmailRequest) Test(org.junit.Test) AbstractServiceFunctionalIntegrationTest(com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest)

Aggregations

SendEmailRequest (com.hack23.cia.service.api.action.admin.SendEmailRequest)4 SendEmailResponse (com.hack23.cia.service.api.action.admin.SendEmailResponse)3 CreateApplicationEventRequest (com.hack23.cia.service.api.action.application.CreateApplicationEventRequest)2 CreateApplicationSessionRequest (com.hack23.cia.service.api.action.application.CreateApplicationSessionRequest)2 AbstractServiceFunctionalIntegrationTest (com.hack23.cia.service.impl.AbstractServiceFunctionalIntegrationTest)2 Test (org.junit.Test)2 Secured (org.springframework.security.access.annotation.Secured)2 SmtpMessage (com.dumbster.smtp.SmtpMessage)1 UserAccount (com.hack23.cia.model.internal.application.user.impl.UserAccount)1 ServiceResponse (com.hack23.cia.service.api.action.common.ServiceResponse)1 SendEmailClickListener (com.hack23.cia.web.impl.ui.application.views.pageclicklistener.SendEmailClickListener)1 ClickListener (com.vaadin.ui.Button.ClickListener)1 FormLayout (com.vaadin.ui.FormLayout)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1