TransactionBackendHandler implements TextProtocolBackendHandler { @Override public BackendResponse execute() throws SQLException { switch (operationType) { case BEGIN: backendTransactionManager.begin(); break; case COMMIT: backendTransactionManager.commit(); break; case ROLLBACK: backendTransactionManager.rollback(); break; default: throw new SQLFeatureNotSupportedException(operationType.name()); } return new UpdateResponse(); } TransactionBackendHandler(final TransactionOperationType operationType, final BackendConnection backendConnection); @Override BackendResponse execute(); @Override boolean next(); @Override QueryData getQueryData();  }
@Test public void assertExecute() throws SQLException { TransactionBackendHandler transactionBackendHandler = new TransactionBackendHandler(TransactionOperationType.BEGIN, backendConnection); BackendResponse actual = transactionBackendHandler.execute(); assertThat(actual, instanceOf(UpdateResponse.class)); }