Skip to content

Commit b2111b6

Browse files
committed
Add beforeeach method to delete all data from mongodb database
Signed-off-by: Otavio Santana <[email protected]>
1 parent a74168d commit b2111b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

mongodb-driver/src/test/java/org/eclipse/jnosql/communication/mongodb/document/MongoDBDocumentCollectionManagerTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import org.eclipse.jnosql.communication.mongodb.document.type.Money;
2626
import org.junit.jupiter.api.Assertions;
2727
import org.junit.jupiter.api.BeforeAll;
28+
import org.junit.jupiter.api.BeforeEach;
2829
import org.junit.jupiter.api.Test;
2930

3031
import java.io.IOException;
@@ -59,6 +60,11 @@ public static void setUp() throws IOException {
5960
entityManager = ManagerFactorySupplier.INSTANCE.get("database");
6061
}
6162

63+
@BeforeEach
64+
public void beforeEach() {
65+
DocumentDeleteQuery.delete().from(COLLECTION_NAME).delete(entityManager);
66+
}
67+
6268
@Test
6369
public void shouldInsert() {
6470
DocumentEntity entity = getEntity();

0 commit comments

Comments
 (0)