use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithDomain in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testGetPostDataMandrillRequestWithEmail.
@Test
public void testGetPostDataMandrillRequestWithEmail() throws Exception {
this.initRequestWithActualMapper();
assertEquals("{\"key\":null,\"domain\":null}", this.request.getPostData(this.emptyEmailRequest));
this.mutableEmailRequest = new MandrillRequestWithDomain();
this.mutableEmailRequest.setKey("12345");
this.mutableEmailRequest.setDomain("email@email.com");
assertEquals("{\"key\":\"12345\",\"domain\":\"email@email.com\"}", this.request.getPostData(this.mutableEmailRequest));
}
use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithDomain in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillUsersRequestTest method testDisableSender.
@Test
public void testDisableSender() throws RequestFailedException {
usersRequest.setRequest(request);
MandrillRequestWithDomain disableRequest = new MandrillRequestWithDomain();
DisableResponse response = new DisableResponse();
Mockito.when(request.postRequest(disableRequest, ServiceMethods.Users.DISABLE_SENDER, DisableResponse.class)).thenReturn(response);
usersRequest.disableSender(disableRequest);
Mockito.verify(request).postRequest(disableRequest, ServiceMethods.Users.DISABLE_SENDER, DisableResponse.class);
}
use of com.cribbstechnologies.clients.mandrill.model.MandrillRequestWithDomain in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testDisableSender.
@Test
public void testDisableSender() {
MandrillRequestWithDomain domainRequest = new MandrillRequestWithDomain();
domainRequest.setDomain("google.com");
try {
DisableResponse response = usersRequest.disableSender(domainRequest);
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
Aggregations