use of com.datastax.oss.driver.internal.querybuilder.update.DefaultUpdate in project java-driver by datastax.
the class UpdateUsingTest method should_throw_exception_with_invalid_timestamp.
@Test
public void should_throw_exception_with_invalid_timestamp() {
DefaultUpdate defaultUpdate = (DefaultUpdate) update("foo").usingTtl(10).setColumn("v", bindMarker()).whereColumn("k").isEqualTo(bindMarker());
Throwable t = catchThrowable(() -> new DefaultUpdate(defaultUpdate.getKeyspace(), defaultUpdate.getTable(), // invalid timestamp object
new Object(), defaultUpdate.getTtl(), defaultUpdate.getAssignments(), defaultUpdate.getRelations(), defaultUpdate.isIfExists(), defaultUpdate.getConditions()));
assertThat(t).isInstanceOf(IllegalArgumentException.class).hasMessage("TIMESTAMP value must be a BindMarker or a Long");
}
use of com.datastax.oss.driver.internal.querybuilder.update.DefaultUpdate in project java-driver by datastax.
the class UpdateUsingTest method should_throw_exception_with_invalid_ttl.
@Test
public void should_throw_exception_with_invalid_ttl() {
DefaultUpdate defaultUpdate = (DefaultUpdate) update("foo").usingTtl(10).setColumn("v", bindMarker()).whereColumn("k").isEqualTo(bindMarker());
Throwable t = catchThrowable(() -> new DefaultUpdate(defaultUpdate.getKeyspace(), defaultUpdate.getTable(), defaultUpdate.getTimestamp(), // invalid TTL object
new Object(), defaultUpdate.getAssignments(), defaultUpdate.getRelations(), defaultUpdate.isIfExists(), defaultUpdate.getConditions()));
assertThat(t).isInstanceOf(IllegalArgumentException.class).hasMessage("TTL value must be a BindMarker or an Integer");
}
Aggregations