use of org.neo4j.kernel.lifecycle.LifeSupport in project neo4j by neo4j.
the class PhysicalLogicalTransactionStoreTest method shouldThrowNoSuchTransactionExceptionIfMetadataNotFound.
@Test
public void shouldThrowNoSuchTransactionExceptionIfMetadataNotFound() throws Exception {
// GIVEN
LogFile logFile = mock(LogFile.class);
TransactionMetadataCache cache = new TransactionMetadataCache(10);
LifeSupport life = new LifeSupport();
final LogicalTransactionStore txStore = new PhysicalLogicalTransactionStore(logFile, cache, new VersionAwareLogEntryReader<>());
try {
life.start();
// WHEN
try {
txStore.getMetadataFor(10);
fail("Should have thrown");
} catch (NoSuchTransactionException e) {
// THEN Good
}
} finally {
life.shutdown();
}
}
Aggregations