use of com.datastax.oss.driver.internal.core.cql.DefaultPreparedStatement in project java-driver by datastax.
the class RequestLogFormatterTest method mockPreparedStatement.
private PreparedStatement mockPreparedStatement(String query, Map<String, DataType> variables) {
ImmutableList.Builder<ColumnDefinition> definitions = ImmutableList.builder();
int i = 0;
for (Map.Entry<String, DataType> entry : variables.entrySet()) {
definitions.add(new DefaultColumnDefinition(new ColumnSpec("test", "foo", entry.getKey(), i, RawType.PRIMITIVES.get(entry.getValue().getProtocolCode())), context));
}
return new DefaultPreparedStatement(Bytes.fromHexString("0x"), query, DefaultColumnDefinitions.valueOf(definitions.build()), Collections.emptyList(), null, null, null, Collections.emptyMap(), null, null, null, null, null, Collections.emptyMap(), null, null, null, Integer.MIN_VALUE, null, null, false, context.getCodecRegistry(), context.getProtocolVersion());
}
Aggregations