Search in sources :

Example 1 with DefaultProtocolVersionRegistry

use of com.datastax.oss.driver.internal.core.DefaultProtocolVersionRegistry in project java-driver by datastax.

the class StatementSizeTest method setup.

@Before
public void setup() {
    MockitoAnnotations.initMocks(this);
    ByteBuffer preparedId = ByteBuffer.wrap(PREPARED_ID);
    when(preparedStatement.getId()).thenReturn(preparedId);
    ByteBuffer resultMetadataId = ByteBuffer.wrap(RESULT_METADATA_ID);
    when(preparedStatement.getResultMetadataId()).thenReturn(resultMetadataId);
    ColumnDefinitions columnDefinitions = DefaultColumnDefinitions.valueOf(ImmutableList.of(phonyColumnDef("ks", "table", "c1", -1, ProtocolConstants.DataType.INT), phonyColumnDef("ks", "table", "c2", -1, ProtocolConstants.DataType.VARCHAR)));
    when(preparedStatement.getVariableDefinitions()).thenReturn(columnDefinitions);
    when(driverContext.getProtocolVersion()).thenReturn(DefaultProtocolVersion.V5);
    when(driverContext.getCodecRegistry()).thenReturn(CodecRegistry.DEFAULT);
    when(driverContext.getProtocolVersionRegistry()).thenReturn(new DefaultProtocolVersionRegistry(null));
    when(config.getDefaultProfile()).thenReturn(defaultProfile);
    when(driverContext.getConfig()).thenReturn(config);
    when(driverContext.getTimestampGenerator()).thenReturn(timestampGenerator);
}
Also used : ColumnDefinitions(com.datastax.oss.driver.api.core.cql.ColumnDefinitions) DefaultProtocolVersionRegistry(com.datastax.oss.driver.internal.core.DefaultProtocolVersionRegistry) ByteBuffer(java.nio.ByteBuffer) Before(org.junit.Before)

Aggregations

ColumnDefinitions (com.datastax.oss.driver.api.core.cql.ColumnDefinitions)1 DefaultProtocolVersionRegistry (com.datastax.oss.driver.internal.core.DefaultProtocolVersionRegistry)1 ByteBuffer (java.nio.ByteBuffer)1 Before (org.junit.Before)1