Created
September 4, 2011 02:33
-
-
Save coderunner/1192139 to your computer and use it in GitHub Desktop.
Revisions
-
coderunner revised this gist
Sep 5, 2011 . No changes.There are no files selected for viewing
-
coderunner created this gist
Sep 4, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ @Test public void shouldReturnedStoredText() { //record mode //record behavior and expected calls reset(request, context, monitoring, store, headers); expect(context.getMonitoring()).andReturn(monitoring); monitoring.incrementRequestCounter(); expect(request.getPath()).andReturn(REQUEST_PATH); expect(request.getHeaders()).andReturn(headers); expect(headers.get(CASE_HEADER)).andReturn("Other Value"); expect(context.getStore()).andReturn(store); expect(store.get(REQUEST_PATH)).andReturn(STORE_BODY); //enter replay mode replay(request, context, monitoring, store, headers); //test call HttpResponse response = requestHandler.handle(request, context); //assertions assertEquals(STORE_BODY, response.getBody()); assertEquals(200, response.getCode()); //verify mocks verify(request, context, monitoring, store, headers); }