graphaware / neo4j-framework

GraphAware Neo4j Framework
245 stars 68 forks source link

Add an assertNotEmpty to GraphUnit #78

Closed jasperblues closed 7 years ago

jasperblues commented 7 years ago

Looks like there was an accidental merge commit here, so don't forget to squash in.

bachmanm commented 7 years ago

Hey @jasperblues - a couple of things: 1) Could you try again so that the diff on GraphUnit.java doesn't show that the whole file has changed? Something to do with spaces vs tabs I guess. 2) The implementation: wouldn't it make sense to return as soon as you find the first node or relationship? Then we already know the db is not empty and we don't have to continue iterating. The same way isEmpty fails fast, you would succeed fast. Just an idea 3) One Javadoc missing a not

        /**
     * Assert that the database is empty.
     *
     * @param database to run the assertion against.
     */
    public static void assertNotEmpty(GraphDatabaseService database) {
        assertNotEmpty(database, InclusionPolicies.all());
    }
jasperblues commented 7 years ago

Oops, will do.

jasperblues commented 7 years ago

There you go. We might have the same problems with incompatible formatter in Neo4j-Expire. And a more files affected.