use of com.scalar.db.io.BlobColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_AcceptCalledMultipleTimesWithNullValue_ShouldSetProperly.
@Test
public void visit_AcceptCalledMultipleTimesWithNullValue_ShouldSetProperly() {
// Arrange
IntColumn column1 = IntColumn.of(ANY_NAME, ANY_INT);
BlobColumn column2 = BlobColumn.ofNull(ANY_NAME);
TextColumn column3 = TextColumn.ofNull(ANY_NAME);
IntColumn column4 = IntColumn.of(ANY_NAME, ANY_INT);
ValueBinder binder = new ValueBinder(bound);
// Act
column1.accept(binder);
column2.accept(binder);
column3.accept(binder);
column4.accept(binder);
// Assert
verify(bound).setInt(0, ANY_INT);
verify(bound).setToNull(1);
verify(bound).setToNull(2);
verify(bound).setInt(3, ANY_INT);
}
use of com.scalar.db.io.BlobColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_BlobColumnAcceptCalled_ShouldCallSetString.
@Test
public void visit_BlobColumnAcceptCalled_ShouldCallSetString() {
// Arrange
BlobColumn column = BlobColumn.of(ANY_NAME, ANY_STRING.getBytes(StandardCharsets.UTF_8));
ValueBinder binder = new ValueBinder(bound);
// Act
column.accept(binder);
// Assert
verify(bound).setBytes(0, (ByteBuffer) ByteBuffer.allocate(ANY_STRING.length()).put(ANY_STRING.getBytes(StandardCharsets.UTF_8)).flip());
}
use of com.scalar.db.io.BlobColumn in project scalardb by scalar-labs.
the class ValueBinderTest method visit_BlobColumnWithNullValueAcceptCalled_ShouldCallSetToNull.
@Test
public void visit_BlobColumnWithNullValueAcceptCalled_ShouldCallSetToNull() {
// Arrange
BlobColumn column = BlobColumn.ofNull(ANY_NAME);
ValueBinder binder = new ValueBinder(bound);
// Act
column.accept(binder);
// Assert
verify(bound).setToNull(0);
}
Aggregations