Skip to content

Commit

Permalink
test: create null id scenario
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Apr 12, 2024
1 parent 7c975df commit 6bd0cd0
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,15 @@ void shouldInsert() {
assertTrue(documentEntity.elements().stream().map(Element::name).anyMatch(s -> s.equals("_id")));
}

@Test
void shouldInsertAndIgnoreIdNull() {
var entity = getEntity();
entity.add("_id", null);
var documentEntity = entityManager.insert(entity);
Element id = documentEntity.find("_id").orElseThrow();
entityManager.delete(DeleteQuery.delete().from(COLLECTION_NAME).where("_id").eq(id.get()).build());
}

@Test
void shouldThrowExceptionWhenInsertWithTTL() {
var entity = getEntity();
Expand Down

0 comments on commit 6bd0cd0

Please sign in to comment.