Skip to content

Commit

Permalink
Update tests for new error messages
Browse files Browse the repository at this point in the history
Reflects changes in more detailed error messages from the server
  • Loading branch information
Steve Chaloner committed May 3, 2024
1 parent 0abf4c9 commit 80fec34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/test/java/seatsio/ErrorHandlingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ public class ErrorHandlingTest extends SeatsioClientTest {
@Test
public void test400() {
SeatsioException e = assertThrows(SeatsioException.class, () -> client.charts.retrieve("unexistingChart"));
assertThat(e.getMessage()).contains("Chart not found: unexistingChart");
assertThat(e.errors).containsExactly(new ApiError("CHART_NOT_FOUND", "Chart not found: unexistingChart"));
assertThat(e.getMessage()).contains("Chart not found: unexistingChart was not found in workspace");
assertThat(e.errors).hasSize(1);
assertThat(e.errors.get(0).getCode()).isEqualTo("CHART_NOT_FOUND");
assertThat(e.errors.get(0).getMessage()).startsWith("Chart not found: unexistingChart was not found in workspace");
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/seatsio/charts/ManageCategoriesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public void updateCategory_doNotChangeAnything() {
public void updateCategory_unknownChart() {
SeatsioException e = assertThrows(SeatsioException.class, () -> client.charts.updateCategory("unknownChart", CategoryKey.of("cat2"),
new CategoryUpdateParams("New label", "#cccccc", false)));
assertThat(e.getMessage()).isEqualTo("Chart not found: unknownChart");
assertThat(e.getMessage()).startsWith("Chart not found: unknownChart was not found in workspace");
}

@Test
Expand Down

0 comments on commit 80fec34

Please sign in to comment.