JdbcEndpointAdapterController implements JdbcController, EndpointAdapter { @Override public void setTransactionState(boolean transactionState) { if (log.isDebugEnabled()) { log.debug(String.format("Received transaction state change: '%s':%n%s", endpointConfiguration.getServerConfiguration().getDatabaseName(), String.valueOf(transactionState))); } this.transactionState = transactionState; if(!endpointConfiguration.isAutoTransactionHandling() && transactionState){ handleMessageAndCheckResponse(JdbcMessage.startTransaction()); } } JdbcEndpointAdapterController(
            JdbcEndpointConfiguration endpointConfiguration,
            EndpointAdapter delegate);   JdbcEndpointAdapterController(
            JdbcEndpointConfiguration endpointConfiguration,
            EndpointAdapter delegate,
            DataSetCreator dataSetCreator); @Override Message handleMessage(Message request); @Override void openConnection(Map<String, String> properties); @Override void closeConnection(); @Override void createPreparedStatement(String stmt); @Override void createStatement(); @Override DataSet executeQuery(String query); @Override DataSet executeStatement(String stmt); @Override int executeUpdate(String updateSql); @Override void closeStatement(); @Override void setTransactionState(boolean transactionState); @Override boolean getTransactionState(); @Override void commitStatements(); @Override void rollbackStatements(); @Override void createCallableStatement(String sql); @Override Endpoint getEndpoint(); @Override EndpointConfiguration getEndpointConfiguration();  }
@Test public void testSetTransactionState(){ final JdbcEndpointAdapterController jdbcEndpointAdapterController = spy(this.jdbcEndpointAdapterController); final boolean expectedBoolean = new Random().nextBoolean(); when(jdbcEndpointConfiguration.isAutoTransactionHandling()).thenReturn(true); jdbcEndpointAdapterController.setTransactionState(expectedBoolean); verify(jdbcEndpointAdapterController, never()).handleMessage(any()); assertEquals(jdbcEndpointAdapterController.getTransactionState(), expectedBoolean); }