Skip to content

Commit 34b57d2

Browse files
committed
Create initial test to delete
Signed-off-by: Otavio Santana <[email protected]>
1 parent 9cef1d4 commit 34b57d2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public void beforeEach() {
5555
}
5656

5757
@Test
58-
public void shouldReturnErrorWhenThereIsNullParameter(){
58+
public void shouldReturnErrorOnSelectWhenThereIsNullParameter(){
5959
Assertions.assertThrows(NullPointerException.class,
6060
() -> entityManager.select(null, null));
6161
Assertions.assertThrows(NullPointerException.class,
@@ -77,6 +77,17 @@ public void shouldFindDocument() {
7777
assertThat(entities, contains(entity));
7878
}
7979

80+
@Test
81+
public void shouldReturnErrorOnDeleteWhenThereIsNullParameter(){
82+
Assertions.assertThrows(NullPointerException.class,
83+
() -> entityManager.delete(null, null));
84+
Assertions.assertThrows(NullPointerException.class,
85+
() -> entityManager.delete(COLLECTION_NAME, null));
86+
87+
Assertions.assertThrows(NullPointerException.class,
88+
() -> entityManager.delete(null, eq("name", "Poliana")));
89+
}
90+
8091
private DocumentEntity getEntity() {
8192
DocumentEntity entity = DocumentEntity.of(COLLECTION_NAME);
8293
Map<String, Object> map = new HashMap<>();

0 commit comments

Comments
 (0)