Skip to content

Commit

Permalink
#3031 Improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
rbygrave committed May 9, 2023
1 parent e29b578 commit 06cad50
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void enumDayMonth_builtIn_overrideAsString() {
assertThat(true).isFalse().as("never get here");

} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand All @@ -72,7 +72,7 @@ public void enumMonth_builtIn_overrideAsOrdinal() {
typeManager.enumType(Month.class, EnumType.STRING);
assertThat(true).isFalse().as("never get here");
} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand All @@ -90,7 +90,7 @@ public void enumDayOfWeek_builtIn_overrideAsString() {
typeManager.enumType(DayOfWeek.class, EnumType.ORDINAL);
assertThat(true).isFalse().as("never get here");
} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand All @@ -105,7 +105,7 @@ public void enumDayOfWeek_builtIn_overrideAsOrdinal() {
typeManager.enumType(DayOfWeek.class, EnumType.STRING);
assertThat(true).isFalse().as("never get here");
} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void testEnumWithSubclasses() throws SQLException {
typeManager.enumType(MyEnum.class, EnumType.STRING);
fail("never get here");
} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand Down Expand Up @@ -91,7 +91,7 @@ void testEnumWithChar() throws SQLException {
typeManager.enumType(MyDayOfWeek.class, EnumType.ORDINAL);
fail("never get here");
} catch (IllegalStateException e) {
assertThat(e.getMessage()).contains("It is mapped using 2 different modes when only one is supported");
assertThat(e.getMessage()).contains("It is mapped using 2 of (ORDINAL, STRING or an Ebean mapping) when only one is supported.");
}
}

Expand Down

0 comments on commit 06cad50

Please sign in to comment.