use of com.cribbstechnologies.clients.mandrill.model.BaseMandrillRequest in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testPing.
@Test
public void testPing() {
BaseMandrillRequest baseRequest = new BaseMandrillRequest();
try {
BaseMandrillStringResponse response = usersRequest.performPing(baseRequest);
assertEquals("\"PONG!\"", response.getResponse());
} catch (RequestFailedException e) {
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.model.BaseMandrillRequest in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillRESTRequestTest method testGetPostDataBaseMandrillRequest.
@Test
public void testGetPostDataBaseMandrillRequest() throws Exception {
this.initRequestWithActualMapper();
assertEquals("{\"key\":null}", this.request.getPostData(this.emptyBaseRequest));
this.mutableBaseRequest = new BaseMandrillRequest();
this.mutableBaseRequest.setKey("this is my key");
assertEquals("{\"key\":\"this is my key\"}", this.request.getPostData(this.mutableBaseRequest));
this.mutableBaseRequest.setKey("this is my key with \"extra\" quotes");
assertEquals("{\"key\":\"this is my key with \\\"extra\\\" quotes\"}", this.request.getPostData(this.mutableBaseRequest));
}
use of com.cribbstechnologies.clients.mandrill.model.BaseMandrillRequest in project Java-Mandrill-Wrapper by cribbstechnologies.
the class UsersTest method testPing2.
@Test
public void testPing2() {
BaseMandrillRequest baseRequest = new BaseMandrillRequest();
try {
PingResponse pingResponse = usersRequest.performPing2(baseRequest);
assertEquals("PONG!", pingResponse.getPingResponse());
} catch (RequestFailedException e) {
e.printStackTrace();
fail(e.getMessage());
}
}
use of com.cribbstechnologies.clients.mandrill.model.BaseMandrillRequest in project Java-Mandrill-Wrapper by cribbstechnologies.
the class MandrillUsersRequestTest method before.
@Before
public void before() {
initMocks(this);
bmr = new BaseMandrillRequest();
bmr.setKey("123");
}
Aggregations