Skip to content
Prev Previous commit
Next Next commit
bugfix ArangoDatabaseTest
  • Loading branch information
michele committed Sep 26, 2019
commit d7e37aeab6344d5cfd8dab1e6c2a8b62251dca76
22 changes: 10 additions & 12 deletions src/test/java/com/arangodb/ArangoDatabaseTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,16 @@ public ArangoDatabaseTest(final Builder builder) {

@Before
public void setUp() {
if (db.collection(COLLECTION_NAME + "2").exists())
db.collection(COLLECTION_NAME + "2").drop();
if (db.collection(COLLECTION_NAME + "1").exists())
db.collection(COLLECTION_NAME + "1").drop();
if (db.collection(COLLECTION_NAME).exists())
db.collection(COLLECTION_NAME).drop();
if (db.collection(COLLECTION_NAME + "edge").exists())
db.collection(COLLECTION_NAME + "edge").drop();
if (db.collection(COLLECTION_NAME + "from").exists())
db.collection(COLLECTION_NAME + "from").drop();
if (db.collection(COLLECTION_NAME + "to").exists())
db.collection(COLLECTION_NAME + "to").drop();
db.getCollections().stream()
.filter(it -> !it.getIsSystem())
.map(CollectionEntity::getName)
.map(db::collection)
.forEach(ArangoCollection::drop);

db.getGraphs().stream()
.map(GraphEntity::getName)
.map(db::graph)
.forEach(ArangoGraph::drop);
}

@Test
Expand Down