unit test for afterResponse event