### Question:
PhysicalLogicalTransactionStore implements LogicalTransactionStore { @Override public TransactionCursor getTransactions( LogPosition position ) throws IOException { return new PhysicalTransactionCursor<>( logFile.getReader( position ), new VersionAwareLogEntryReader<>() ); } PhysicalLogicalTransactionStore( LogFiles logFiles,
            TransactionMetadataCache transactionMetadataCache,
            LogEntryReader<ReadableClosablePositionAwareChannel> logEntryReader, Monitors monitors,
            boolean failOnCorruptedLogFiles ); @Override TransactionCursor getTransactions( LogPosition position ); @Override TransactionCursor getTransactionsInReverseOrder( LogPosition backToPosition ); @Override TransactionCursor getTransactions( final long transactionIdToStartFrom ); @Override TransactionMetadata getMetadataFor( long transactionId ); @Override boolean existsOnDisk( long transactionId );  }### Answer:
@Test public void shouldThrowNoSuchTransactionExceptionIfLogFileIsMissing() throws Exception { LogFile logFile = mock( LogFile.class ); LogFiles logFiles = mock( LogFiles.class ); when( logFiles.getLogFile() ).thenReturn( logFile ); when( logFile.getReader( any( LogPosition.class) ) ).thenThrow( new FileNotFoundException() ); TransactionMetadataCache cache = new TransactionMetadataCache(); cache.cacheTransactionMetadata( 10, new LogPosition( 2, 130 ), 1, 1, 100, System.currentTimeMillis() ); LifeSupport life = new LifeSupport(); final LogicalTransactionStore txStore = new PhysicalLogicalTransactionStore( logFiles, cache, new VersionAwareLogEntryReader<>(), monitors, true ); try { life.start(); try { txStore.getTransactions( 10 ); fail(); } catch ( NoSuchTransactionException e ) { } } finally { life.shutdown(); } }