Elffuss BraidHub

kikocis/java-driver public

Update MapperUDTTest to work with C* 3.9 error messages
Changeset84da8bad91bba9b5ec9de680deea56efa67ffbdfc79da69283250f5630247c43
AuthorAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-10-04 13:29 -05:00
CommitterAndrew Tolbert <andrew.tolbert@datastax.com> · 2016-10-04 14:31 -05:00
Parents178485c47945

Browse the files at this changeset

1 file changed

modified driver-mapping/src/test/java/com/datastax/driver/mapping/MapperUDTTest.java +4 −3
@@ -498,13 +498,15 @@
498498 mapper.save(user);
499499 fail("Expected InvalidQueryException");
500500 } catch (InvalidQueryException e) {
501- assertThat(e.getMessage()).isEqualTo("Unknown identifier mainaddress");
501+ // Error message varies by C* version.
502+ assertThat(e.getMessage()).isIn("Unknown identifier mainaddress", "Undefined column name mainaddress");
502503 }
503504 try {
504505 mapper.get(user.getUserId());
505506 fail("Expected InvalidQueryException");
506507 } catch (InvalidQueryException e) {
507- assertThat(e.getMessage()).isEqualTo("Undefined name mainaddress in selection clause");
508+ // Error message varies by C* version.
509+ assertThat(e.getMessage()).isIn("Undefined name mainaddress in selection clause", "Undefined column name mainaddress");
508510 }
509511 // trying to use a new mapper
510512 try {
@@ -622,7 +624,6 @@
622624 }
623625 }
624626
625-
626627 /**
627628 * Ensures that when attempting to create a {@link TypeCodec} from a class that has a field that does not exist in
628629 * the UDT that an {@link IllegalArgumentException} is thrown.