}
public void testMockedDispatcher() {
/** Mock/Stub mocked example service: */
ExampleService exampleService = new ExampleService() {
@Override
public void getExampleDto(MethodCallback<ExampleDto> callback) {
ExampleDto exampleDto = new ExampleDto();
exampleDto.name = "name";
callback.onSuccess(null, exampleDto);
}
@Override
public Request getExampleDtoCancelable(MethodCallback<ExampleDto> callback) {
ExampleDto exampleDto = new ExampleDto();
exampleDto.name = "name";
callback.onSuccess(null, exampleDto);
return null;
}
};
/** test*/
exampleService.getExampleDto(new MethodCallback<ExampleDto>() {
@Override
public void onSuccess(Method method, ExampleDto response) {
assertEquals(response.name, "name");
}