use of com.cribbstechnologies.clients.mandrill.model.response.users.DisableResponse in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testDisableResponseConversion.
@Test
public void testDisableResponseConversion() throws IOException {
this.initRequestWithActualMapper();
StringWriter sw = new StringWriter();
IOUtils.copy(this.getClass().getClassLoader().getResourceAsStream("users/disableSenderResponse.txt"), sw);
DisableResponse response = (DisableResponse) this.request.convertResponseData(sw.toString(), DisableResponse.class);
assertEquals("example domain", response.getDomain());
assertEquals("example created_at", response.getCreated_at());
assertEquals("example approved_at", response.getApproved_at());
assertTrue(response.isIs_enabled());
}
use of com.cribbstechnologies.clients.mandrill.model.response.users.DisableResponse 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.response.users.DisableResponse in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testVerifySenderResponseConversion.
@Test
public void testVerifySenderResponseConversion() throws IOException {
this.initRequestWithActualMapper();
StringWriter sw = new StringWriter();
IOUtils.copy(this.getClass().getClassLoader().getResourceAsStream("users/verifySenderResponse.txt"), sw);
DisableResponse response = (DisableResponse) this.request.convertResponseData(sw.toString(), DisableResponse.class);
assertEquals("example domain", response.getDomain());
assertEquals("example created_at", response.getCreated_at());
assertEquals("example approved_at", response.getApproved_at());
assertTrue(response.isIs_enabled());
}
use of com.cribbstechnologies.clients.mandrill.model.response.users.DisableResponse 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