### Question:
TransactionStateMachine implements StatementProcessor { @Override public void validateTransaction() throws KernelException { KernelTransaction tx = ctx.currentTransaction; if ( tx != null ) { Optional<Status> statusOpt = tx.getReasonIfTerminated(); if ( statusOpt.isPresent() ) { if ( statusOpt.get().code().classification().rollbackTransaction() ) { ctx.pendingTerminationNotice = statusOpt.get(); reset(); } } } } TransactionStateMachine( TransactionStateMachineSPI spi, AuthenticationResult authenticationResult, Clock clock ); State state(); @Override void beginTransaction( Bookmark bookmark ); @Override void beginTransaction( Bookmark bookmark, Duration txTimeout, Map<String,Object> txMetadata ); @Override StatementMetadata run( String statement, MapValue params ); @Override StatementMetadata run( String statement, MapValue params, Bookmark bookmark, Duration txTimeout, Map<String,Object> txMetaData ); @Override Bookmark streamResult( ThrowingConsumer<BoltResult, Exception> resultConsumer ); @Override Bookmark commitTransaction(); @Override void rollbackTransaction(); @Override boolean hasOpenStatement(); @Override void reset(); @Override void markCurrentTransactionForTermination(); @Override void validateTransaction(); @Override boolean hasTransaction();  }### Answer:
@Test void shouldDoNothingInAutoCommitTransactionUponInitialisationWhenValidated() throws Exception { KernelTransaction transaction = newTimedOutTransaction(); TransactionStateMachineV1SPI stateMachineSPI = newTransactionStateMachineSPI( transaction ); TransactionStateMachine stateMachine = newTransactionStateMachine( stateMachineSPI ); assertThat( stateMachine.state, is( TransactionStateMachine.State.AUTO_COMMIT ) ); assertNull( stateMachine.ctx.currentTransaction ); stateMachine.validateTransaction(); assertThat( stateMachine.state, is( TransactionStateMachine.State.AUTO_COMMIT ) ); assertNull( stateMachine.ctx.currentTransaction ); verify( transaction, never() ).getReasonIfTerminated(); verify( transaction, never() ).failure(); verify( transaction, never() ).close(); }