use of com.amazonaws.handlers.RequestHandler2 in project aws-sdk-android by aws-amplify.
the class AmazonWebServiceClientTest method testAddAndRemoveRequestHandler2.
@Test
public void testAddAndRemoveRequestHandler2() {
final RequestHandler2 rh = new RequestHandler2() {
@Override
public void beforeRequest(Request<?> request) {
}
@Override
public void afterResponse(Request<?> request, Response<?> response) {
}
@Override
public void afterError(Request<?> request, Response<?> response, Exception e) {
}
};
final AmazonTestClient client = new AmazonTestClient();
client.addRequestHandler(rh);
assertEquals(client.requestHandler2s.size(), 1);
assertSame(client.requestHandler2s.get(0), rh);
client.removeRequestHandler(rh);
assertEquals(client.requestHandler2s.size(), 0);
}
Aggregations