Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
padamski committed Jul 13, 2020
2 parents 4e1daa7 + 454a766 commit 642f745
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public HttpClientMock(String defaultHost) {
*/
public void reset() {
this.rulesUnderConstruction.clear();
this.rules.clear();
this.requests.clear();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,18 @@ public void after_reset_every_call_should_result_in_status_404() throws IOExcept

httpClientMock.onPost("/login").doReturnStatus(200);
httpClientMock.reset();
HttpResponse login = httpClientMock.execute(new HttpPost("http://localhost/login"));

assertThat(login, hasStatus(404));
}

@Test
public void after_execute_and_reset_every_call_should_result_in_status_404() throws IOException {
HttpClientMock httpClientMock = new HttpClientMock("http://localhost");

httpClientMock.onPost("/login").doReturnStatus(200);
httpClientMock.execute(new HttpPost("http://localhost/login"));
httpClientMock.reset();
HttpResponse login = httpClientMock.execute(new HttpPost("http://localhost/login"));

assertThat(login, hasStatus(404));
Expand Down

0 comments on commit 642f745

Please sign in to comment.