### Question:
DefaultMasterImplSPI implements MasterImpl.SPI { @Override public RequestContext flushStoresAndStreamStoreFiles( StoreWriter writer ) { StoreCopyServer streamer = new StoreCopyServer( neoStoreDataSource, checkPointer, fileSystem, databaseDirectory, monitors.newMonitor( StoreCopyServer.Monitor.class, StoreCopyServer.class.getName() ) ); return streamer.flushStoresAndStreamStoreFiles( STORE_COPY_CHECKPOINT_TRIGGER, writer, false ); } DefaultMasterImplSPI( GraphDatabaseAPI graphDb,
                                 FileSystemAbstraction fileSystemAbstraction,
                                 Monitors monitors,
                                 TokenHolders tokenHolders,
                                 IdGeneratorFactory idGeneratorFactory,
                                 TransactionCommitProcess transactionCommitProcess,
                                 CheckPointer checkPointer,
                                 TransactionIdStore transactionIdStore,
                                 LogicalTransactionStore logicalTransactionStore,
                                 NeoStoreDataSource neoStoreDataSource,
                                 LogProvider logProvider ); @Override boolean isAccessible(); @Override int getOrCreateLabel( String name ); @Override int getOrCreateProperty( String name ); @Override IdAllocation allocateIds( IdType idType ); @Override StoreId storeId(); @Override long applyPreparedTransaction( TransactionRepresentation preparedTransaction ); @Override Integer createRelationshipType( String name ); @Override long getTransactionChecksum( long txId ); @Override RequestContext flushStoresAndStreamStoreFiles( StoreWriter writer ); @Override Response<T> packTransactionStreamResponse( RequestContext context, T response ); @Override Response<T> packTransactionObligationResponse( RequestContext context, T response ); @Override Response<T> packEmptyResponse( T response );  }### Answer:
@Test public void flushStoreFilesWithCorrectCheckpointTriggerName() throws IOException { CheckPointer checkPointer = mock( CheckPointer.class ); StoreCopyCheckPointMutex mutex = new StoreCopyCheckPointMutex(); NeoStoreDataSource dataSource = mock( NeoStoreDataSource.class ); when( dataSource.getStoreCopyCheckPointMutex() ).thenReturn( mutex ); when( dataSource.listStoreFiles( anyBoolean() ) ).thenReturn( Iterators.emptyResourceIterator() ); DefaultMasterImplSPI master = new DefaultMasterImplSPI( mock( GraphDatabaseAPI.class, RETURNS_MOCKS ), mock( FileSystemAbstraction.class ), new Monitors(), mockedTokenHolders(), mock( IdGeneratorFactory.class ), mock( TransactionCommitProcess.class ), checkPointer, mock( TransactionIdStore.class ), mock( LogicalTransactionStore.class ), dataSource, NullLogProvider.getInstance() ); master.flushStoresAndStreamStoreFiles( mock( StoreWriter.class ) ); TriggerInfo expectedTriggerInfo = new SimpleTriggerInfo( DefaultMasterImplSPI.STORE_COPY_CHECKPOINT_TRIGGER ); verify( checkPointer ).tryCheckPoint( expectedTriggerInfo ); }