Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests for new error messages #179

Merged
merged 1 commit into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading