/** {@inheritDoc} */ @Override public CodecRegistry getCodecRegistry() { return st.getCodecRegistry(); }
@BeforeMethod(groups = {"unit"}) public void setup() { MockitoAnnotations.initMocks(this); PreparedId preparedId = new PreparedId( new PreparedId.PreparedMetadata(MD5Digest.wrap(PREPARED_ID), null), new PreparedId.PreparedMetadata(MD5Digest.wrap(RESULT_METADATA_ID), null), new int[0], ProtocolVersion.V5); Mockito.when(preparedStatement.getPreparedId()).thenReturn(preparedId); ColumnDefinitions columnDefinitions = new ColumnDefinitions( new Definition[] { new Definition("ks", "table", "c1", DataType.cint()), new Definition("ks", "table", "c2", DataType.text()) }, CodecRegistry.DEFAULT_INSTANCE); Mockito.when(preparedStatement.getVariables()).thenReturn(columnDefinitions); Mockito.when(preparedStatement.getIncomingPayload()).thenReturn(null); Mockito.when(preparedStatement.getOutgoingPayload()).thenReturn(null); Mockito.when(preparedStatement.getCodecRegistry()).thenReturn(CodecRegistry.DEFAULT_INSTANCE); }
/** * Creates a new {@code BoundStatement} from the provided prepared statement. * * @param statement the prepared statement from which to create a {@code BoundStatement}. */ public BoundStatement(PreparedStatement statement) { this.statement = statement; this.wrapper = new DataWrapper(this, statement.getVariables().size()); for (int i = 0; i < wrapper.values.length; i++) { wrapper.values[i] = UNSET; } if (statement.getConsistencyLevel() != null) this.setConsistencyLevel(statement.getConsistencyLevel()); if (statement.getSerialConsistencyLevel() != null) this.setSerialConsistencyLevel(statement.getSerialConsistencyLevel()); if (statement.isTracing()) this.enableTracing(); if (statement.getRetryPolicy() != null) this.setRetryPolicy(statement.getRetryPolicy()); if (statement.getOutgoingPayload() != null) this.setOutgoingPayload(statement.getOutgoingPayload()); else // propagate incoming payload as outgoing payload, if no outgoing payload has been explicitly // set this.setOutgoingPayload(statement.getIncomingPayload()); this.codecRegistry = statement.getCodecRegistry(); if (statement.isIdempotent() != null) { this.setIdempotent(statement.isIdempotent()); } }
@BeforeMethod(groups = {"unit"}) public void setup() { MockitoAnnotations.initMocks(this); PreparedId preparedId = new PreparedId( new PreparedId.PreparedMetadata(MD5Digest.wrap(PREPARED_ID), null), new PreparedId.PreparedMetadata(MD5Digest.wrap(RESULT_METADATA_ID), null), new int[0], ProtocolVersion.V5); Mockito.when(preparedStatement.getPreparedId()).thenReturn(preparedId); ColumnDefinitions columnDefinitions = new ColumnDefinitions( new Definition[] { new Definition("ks", "table", "c1", DataType.cint()), new Definition("ks", "table", "c2", DataType.text()) }, CodecRegistry.DEFAULT_INSTANCE); Mockito.when(preparedStatement.getVariables()).thenReturn(columnDefinitions); Mockito.when(preparedStatement.getIncomingPayload()).thenReturn(null); Mockito.when(preparedStatement.getOutgoingPayload()).thenReturn(null); Mockito.when(preparedStatement.getCodecRegistry()).thenReturn(CodecRegistry.DEFAULT_INSTANCE); }
/** * Creates a new {@code BoundStatement} from the provided prepared * statement. * * @param statement the prepared statement from which to create a {@code BoundStatement}. */ public BoundStatement(PreparedStatement statement) { this.statement = statement; this.wrapper = new DataWrapper(this, statement.getVariables().size()); for (int i = 0; i < wrapper.values.length; i++) { wrapper.values[i] = UNSET; } if (statement.getConsistencyLevel() != null) this.setConsistencyLevel(statement.getConsistencyLevel()); if (statement.getSerialConsistencyLevel() != null) this.setSerialConsistencyLevel(statement.getSerialConsistencyLevel()); if (statement.isTracing()) this.enableTracing(); if (statement.getRetryPolicy() != null) this.setRetryPolicy(statement.getRetryPolicy()); if (statement.getOutgoingPayload() != null) this.setOutgoingPayload(statement.getOutgoingPayload()); else // propagate incoming payload as outgoing payload, if no outgoing payload has been explicitly set this.setOutgoingPayload(statement.getIncomingPayload()); this.codecRegistry = statement.getCodecRegistry(); if (statement.isIdempotent() != null) { this.setIdempotent(statement.isIdempotent()); } }
/** * Creates a new {@code BoundStatement} from the provided prepared * statement. * * @param statement the prepared statement from which to create a {@code BoundStatement}. */ public BoundStatement(PreparedStatement statement) { this.statement = statement; this.wrapper = new DataWrapper(this, statement.getVariables().size()); for (int i = 0; i < wrapper.values.length; i++) { wrapper.values[i] = UNSET; } if (statement.getConsistencyLevel() != null) this.setConsistencyLevel(statement.getConsistencyLevel()); if (statement.getSerialConsistencyLevel() != null) this.setSerialConsistencyLevel(statement.getSerialConsistencyLevel()); if (statement.isTracing()) this.enableTracing(); if (statement.getRetryPolicy() != null) this.setRetryPolicy(statement.getRetryPolicy()); if (statement.getOutgoingPayload() != null) this.setOutgoingPayload(statement.getOutgoingPayload()); else // propagate incoming payload as outgoing payload, if no outgoing payload has been explicitly set this.setOutgoingPayload(statement.getIncomingPayload()); this.codecRegistry = statement.getCodecRegistry(); if (statement.isIdempotent() != null) { this.setIdempotent(statement.isIdempotent()); } }
/** * Creates a new {@code BoundStatement} from the provided prepared * statement. * * @param statement the prepared statement from which to create a {@code BoundStatement}. */ public BoundStatement(PreparedStatement statement) { this.statement = statement; this.wrapper = new DataWrapper(this, statement.getVariables().size()); for (int i = 0; i < wrapper.values.length; i++) { wrapper.values[i] = UNSET; } if (statement.getConsistencyLevel() != null) this.setConsistencyLevel(statement.getConsistencyLevel()); if (statement.getSerialConsistencyLevel() != null) this.setSerialConsistencyLevel(statement.getSerialConsistencyLevel()); if (statement.isTracing()) this.enableTracing(); if (statement.getRetryPolicy() != null) this.setRetryPolicy(statement.getRetryPolicy()); if (statement.getOutgoingPayload() != null) this.setOutgoingPayload(statement.getOutgoingPayload()); else // propagate incoming payload as outgoing payload, if no outgoing payload has been explicitly set this.setOutgoingPayload(statement.getIncomingPayload()); this.codecRegistry = statement.getCodecRegistry(); if (statement.isIdempotent() != null) { this.setIdempotent(statement.isIdempotent()); } }