Skip to content

Commit

Permalink
Check error status code
Browse files Browse the repository at this point in the history
  • Loading branch information
Janelle Law committed Jul 19, 2021
1 parent e7f5f27 commit 9ce0aec
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/test/java/itest/AutoRulesIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ void testGetNonExistentRuleThrows() throws Exception {

ExecutionException ex =
Assertions.assertThrows(ExecutionException.class, () -> response.get());
MatcherAssert.assertThat(
((HttpStatusException) ex.getCause()).getStatusCode(), Matchers.equalTo(404));
MatcherAssert.assertThat(ex.getCause().getMessage(), Matchers.equalTo("Not Found"));
}

Expand All @@ -349,6 +351,8 @@ void testDeleteNonExistentRuleThrows() throws Exception {

ExecutionException ex =
Assertions.assertThrows(ExecutionException.class, () -> response.get());
MatcherAssert.assertThat(
((HttpStatusException) ex.getCause()).getStatusCode(), Matchers.equalTo(404));
MatcherAssert.assertThat(ex.getCause().getMessage(), Matchers.equalTo("Not Found"));
}
}

0 comments on commit 9ce0aec

Please sign in to comment.