Skip to content

Commit

Permalink
Fix silly test problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
fickludd committed Apr 17, 2018
1 parent 3669bd9 commit 922d2b9
Showing 1 changed file with 7 additions and 6 deletions.
Expand Up @@ -32,6 +32,7 @@
import org.neo4j.values.storable.Values;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand Down Expand Up @@ -268,9 +269,6 @@ public void shouldThrowWhenSettingPropertyOnDeletedNode() throws Exception
{
// wanted
}

// Then
assertNoProperty( node, propertyKey );
}

@Test
Expand Down Expand Up @@ -485,14 +483,17 @@ private long createNodeWithProperty( String propertyKey, Object value )

private void assertNoLabels( long nodeId )
{
assertLabels( nodeId );
try ( org.neo4j.graphdb.Transaction ignore = graphDb.beginTx() )
{
assertThat( graphDb.getNodeById( nodeId ).getLabels(), equalTo( Iterables.empty() ) );
}
}

private void assertLabels( long nodeId, String... labels )
private void assertLabels( long nodeId, String label )
{
try ( org.neo4j.graphdb.Transaction ignore = graphDb.beginTx() )
{
assertThat( graphDb.getNodeById( nodeId ).getLabels(), equalTo( Iterables.asIterable( labels ) ) );
assertThat( graphDb.getNodeById( nodeId ).getLabels(), containsInAnyOrder( label( label ) ) );
}
}

Expand Down

0 comments on commit 922d2b9

Please sign in to comment.