public BDDMyOngoingStubbing<T> willCallRealMethod() { return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenCallRealMethod()); }
public BDDMyOngoingStubbing<T> willCallRealMethod() { return new BDDOngoingStubbingImpl<T>(mockitoOngoingStubbing.thenCallRealMethod()); }
private RecordFormats format( Capability... capabilities ) { RecordFormats formats = mock( BaseRecordFormats.class ); when( formats.capabilities() ).thenReturn( capabilities ); when( formats.hasCompatibleCapabilities( any( RecordFormats.class ), any( CapabilityType.class ) ) ).thenCallRealMethod(); return formats; } }
@Before public void setUp() throws MisconfiguredIndexException { when( mockedIndexProvider.getProviderDescriptor() ).thenReturn( PROVIDER_DESCRIPTOR ); when( mockedIndexProvider.storeMigrationParticipant( any( FileSystemAbstraction.class ), any( PageCache.class ) ) ) .thenReturn( StoreMigrationParticipant.NOT_PARTICIPATING ); when( mockedIndexProvider.bless( any( IndexDescriptor.class ) ) ).thenCallRealMethod(); }
@Test public void testVisitIndexDefineCommand() throws Exception { IndexDefineCommand cmd = mock( IndexDefineCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexDefineCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexDefineCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexDefineCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexDefineCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitIndexRemoveCommand() throws Exception { IndexCommand.RemoveCommand cmd = mock( IndexCommand.RemoveCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexRemoveCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexRemoveCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexRemoveCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexRemoveCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitIndexDeleteCommand() throws Exception { IndexCommand.DeleteCommand cmd = mock( IndexCommand.DeleteCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexDeleteCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexDeleteCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexDeleteCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexDeleteCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitRelationshipCommand() throws Exception { Command.RelationshipCommand cmd = mock( Command.RelationshipCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitRelationshipCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitRelationshipCommand( cmd ); inOrder.verify( txApplier2 ).visitRelationshipCommand( cmd ); inOrder.verify( txApplier3 ).visitRelationshipCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitLabelTokenCommand() throws Exception { Command.LabelTokenCommand cmd = mock( Command.LabelTokenCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitLabelTokenCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitLabelTokenCommand( cmd ); inOrder.verify( txApplier2 ).visitLabelTokenCommand( cmd ); inOrder.verify( txApplier3 ).visitLabelTokenCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitNodeCommand() throws Exception { Command.NodeCommand cmd = mock( Command.NodeCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitNodeCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitNodeCommand( cmd ); inOrder.verify( txApplier2 ).visitNodeCommand( cmd ); inOrder.verify( txApplier3 ).visitNodeCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitRelationshipTypeTokenCommand() throws Exception { Command.RelationshipTypeTokenCommand cmd = mock( Command.RelationshipTypeTokenCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitRelationshipTypeTokenCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitRelationshipTypeTokenCommand( cmd ); inOrder.verify( txApplier2 ).visitRelationshipTypeTokenCommand( cmd ); inOrder.verify( txApplier3 ).visitRelationshipTypeTokenCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitIndexAddRelationshipCommand() throws Exception { IndexCommand.AddRelationshipCommand cmd = mock( IndexCommand.AddRelationshipCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexAddRelationshipCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexAddRelationshipCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexAddRelationshipCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexAddRelationshipCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitIndexCreateCommand() throws Exception { IndexCommand.CreateCommand cmd = mock( IndexCommand.CreateCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitIndexCreateCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitIndexCreateCommand( cmd ); inOrder.verify( txApplier2 ).visitIndexCreateCommand( cmd ); inOrder.verify( txApplier3 ).visitIndexCreateCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitNeoStoreCommand() throws Exception { // Make sure it just calls through to visit Command.NeoStoreCommand cmd = mock( Command.NeoStoreCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitNeoStoreCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitNeoStoreCommand( cmd ); inOrder.verify( txApplier2 ).visitNeoStoreCommand( cmd ); inOrder.verify( txApplier3 ).visitNeoStoreCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitRelationshipCountsCommand() throws Exception { Command.RelationshipCountsCommand cmd = mock( Command.RelationshipCountsCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitRelationshipCountsCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitRelationshipCountsCommand( cmd ); inOrder.verify( txApplier2 ).visitRelationshipCountsCommand( cmd ); inOrder.verify( txApplier3 ).visitRelationshipCountsCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); } }
@Test public void testVisitPropertyCommand() throws Exception { Command.PropertyCommand cmd = mock( Command.PropertyCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitPropertyCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitPropertyCommand( cmd ); inOrder.verify( txApplier2 ).visitPropertyCommand( cmd ); inOrder.verify( txApplier3 ).visitPropertyCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitRelationshipGroupCommand() throws Exception { Command.RelationshipGroupCommand cmd = mock( Command.RelationshipGroupCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitRelationshipGroupCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitRelationshipGroupCommand( cmd ); inOrder.verify( txApplier2 ).visitRelationshipGroupCommand( cmd ); inOrder.verify( txApplier3 ).visitRelationshipGroupCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Test public void testVisitNodeCountsCommand() throws Exception { Command.NodeCountsCommand cmd = mock( Command.NodeCountsCommand.class ); when( cmd.handle( any( CommandVisitor.class ) ) ).thenCallRealMethod(); // WHEN boolean result = facade.visitNodeCountsCommand( cmd ); // THEN InOrder inOrder = inOrder( txApplier1, txApplier2, txApplier3 ); inOrder.verify( txApplier1 ).visitNodeCountsCommand( cmd ); inOrder.verify( txApplier2 ).visitNodeCountsCommand( cmd ); inOrder.verify( txApplier3 ).visitNodeCountsCommand( cmd ); inOrder.verifyNoMoreInteractions(); assertFalse( result ); }
@Before public void before() throws MisconfiguredIndexException { when( mockedIndexProvider.getProviderDescriptor() ).thenReturn( PROVIDER_DESCRIPTOR ); when( mockedIndexProvider.storeMigrationParticipant( any( FileSystemAbstraction.class ), any( PageCache.class ) ) ) .thenReturn( StoreMigrationParticipant.NOT_PARTICIPATING ); when( mockedIndexProvider.bless( any( IndexDescriptor.class ) ) ).thenCallRealMethod(); TestGraphDatabaseFactory factory = new TestGraphDatabaseFactory(); factory.setFileSystem( fs.get() ); factory.setKernelExtensions( Collections.singletonList( mockedIndexProviderFactory ) ); db = (GraphDatabaseAPI) factory.newImpermanentDatabaseBuilder().setConfig( default_schema_provider, PROVIDER_DESCRIPTOR.name() ).newGraphDatabase(); ctxSupplier = db.getDependencyResolver().resolveDependency( ThreadToStatementContextBridge.class ); }
private long dbWithIndexAndSingleIndexedNode() throws Exception { IndexPopulator populator = mock( IndexPopulator.class ); IndexProvider provider = mock( IndexProvider.class ); when( provider.getProviderDescriptor() ).thenReturn( DESCRIPTOR ); when( provider.getPopulator( any( StoreIndexDescriptor.class ), any( IndexSamplingConfig.class ) ) ) .thenReturn( populator ); when( provider.bless( any( IndexDescriptor.class ) ) ).thenCallRealMethod(); BatchInserter inserter = newBatchInserterWithIndexProvider( singleInstanceIndexProviderFactory( KEY, provider ), provider.getProviderDescriptor() ); inserter.createDeferredSchemaIndex( label("Hacker") ).on( "handle" ).create(); long nodeId = inserter.createNode( map( "handle", "Jakewins" ), label( "Hacker" ) ); inserter.shutdown(); return nodeId; }