@Override protected boolean matchesSafely( Deferred<?> deferred, Description description ) { Collection<?> collection = deferred.collection(); if ( !collection.isEmpty() ) { description.appendText( "was " + collection.toString() ); return false; } return true; }
@Override protected boolean matchesSafely( Neo4jMatchers.Deferred<IndexDefinition> indexes, Description description ) { for ( IndexDefinition current : indexes.collection() ) { Schema.IndexState currentState = db.schema().getIndexState( current ); if ( !currentState.equals( expectedState ) ) { description.appendValue( current ).appendText( " has state " ).appendValue( currentState ); return false; } } return true; }
@Override protected boolean matchesSafely( Neo4jMatchers.Deferred<T> nodes, Description description ) { Set<T> expected = asSet( expectedObjects ); Set<T> found = Iterables.asSet( nodes.collection() ); if ( !found.containsAll( expected ) ) { description.appendText( "found " + found.toString() ); return false; } return true; }
@Override protected boolean matchesSafely( Neo4jMatchers.Deferred<?> nodes, Description description ) { int foundSize = nodes.collection().size(); if ( foundSize != expectedSize ) { description.appendText( "found " + nodes.collection().toString() ); return false; } return true; }
@Override protected boolean matchesSafely( Neo4jMatchers.Deferred<T> nodes, Description description ) { Set<T> expected = asSet( expectedObjects ); Set<T> found = Iterables.asSet( nodes.collection() ); if ( !expected.equals( found ) ) { description.appendText( "found " + found.toString() ); return false; } return true; }
public Collection<T> collection() { try ( Transaction ignore = db.beginTx() ) { return Iterables.asCollection( manifest() ); } }