use of com.scalar.db.api.PutIfExists in project scalardb by scalar-labs.
the class StorageIntegrationTestBase method put_PutWithIfExistsGivenWhenNoSuchRecord_ShouldThrowNoMutationException.
@Test
public void put_PutWithIfExistsGivenWhenNoSuchRecord_ShouldThrowNoMutationException() throws ExecutionException {
// Arrange
int pKey = 0;
int cKey = 0;
List<Put> puts = preparePuts();
puts.get(0).withCondition(new PutIfExists());
Get get = prepareGet(pKey, cKey);
// Act Assert
assertThatThrownBy(() -> storage.put(puts.get(0))).isInstanceOf(NoMutationException.class);
// Assert
Optional<Result> actual = storage.get(get);
assertThat(actual.isPresent()).isFalse();
}
Aggregations