Skip to content

Commit d8d2ac0

Browse files
committed
test: create scenarios to mongodb
Signed-off-by: Otavio Santana <[email protected]>
1 parent d1d750e commit d8d2ac0

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

jnosql-mongodb/src/test/java/org/eclipse/jnosql/databases/mongodb/communication/MongoDBDocumentManagerTest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,21 @@ void shouldUpdateNull(){
607607
});
608608
}
609609

610+
@Test
611+
void shouldInsertUUID() {
612+
var entity = getEntity();
613+
entity.add("uuid", UUID.randomUUID());
614+
var documentEntity = entityManager.insert(entity);
615+
Optional<Element> uuid = documentEntity.find("uuid");
616+
SoftAssertions.assertSoftly(soft -> {
617+
soft.assertThat(uuid).isPresent();
618+
Element element = uuid.orElseThrow();
619+
soft.assertThat(element.name()).isEqualTo("uuid");
620+
soft.assertThat(element.get(UUID.class)).isInstanceOf(UUID.class);
621+
});
622+
623+
}
624+
610625

611626
private CommunicationEntity createDocumentList() {
612627
CommunicationEntity entity = CommunicationEntity.of("AppointmentBook");

0 commit comments

Comments
 (0)