JdbcEndpointAdapterController implements JdbcController, EndpointAdapter { @Override public int executeUpdate(String updateSql) throws JdbcServerException { log.info("Received execute update request: " + updateSql); Message response = handleMessageAndCheckResponse(JdbcMessage.execute(updateSql)); return Optional.ofNullable( response.getHeader(JdbcMessageHeaders.JDBC_ROWS_UPDATED)) .map(Object::toString).map(Integer::valueOf) .orElse(0); } 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 testExecuteUpdate(){ final JdbcEndpointAdapterController jdbcEndpointAdapterController = spy(this.jdbcEndpointAdapterController); final Message errorMessage = mock(Message.class); when(errorMessage.getHeader(JdbcMessageHeaders.JDBC_ROWS_UPDATED)).thenReturn("2"); doReturn(errorMessage).when(jdbcEndpointAdapterController).handleMessage(any()); final int rowsUpdated = jdbcEndpointAdapterController.executeUpdate("statement"); verify(jdbcEndpointAdapterController).handleMessage(any()); assertEquals(rowsUpdated, 2); }