4, sweeper); sweeper.initialize(txManager); when(mockServices.getTransactionManager()).thenReturn(txManager); return mockServices;
@Before public void setUp() throws Exception { timestampService = new InMemoryTimestampService(); KeyValueService kvs = getBaseKeyValueService(); keyValueServiceWithStats = new StatsTrackingKeyValueService(kvs); keyValueService = spy(new TrackingKeyValueService(keyValueServiceWithStats)); TransactionTables.createTables(kvs); transactionService = TransactionServices.createForTesting(keyValueService, timestampService, false); conflictDetectionManager = ConflictDetectionManagers.createWithoutWarmingCache(keyValueService); sweepStrategyManager = SweepStrategyManagers.createDefault(keyValueService); sweepQueue = spy(TargetedSweeper.createUninitializedForTest(() -> sweepQueueShards)); serializableTxManager = new TestTransactionManagerImpl( metricsManager, keyValueService, timestampService, timestampService, lockClient, lockService, transactionService, conflictDetectionManager, sweepStrategyManager, sweepQueue, MoreExecutors.newDirectExecutorService()); sweepQueue.initialize(serializableTxManager); txManager = new CachingTestTransactionManager(serializableTxManager); }