Skip to content

Commit 3f6900f

Browse files
committed
feat: remove new enum to reuse the current instead
Signed-off-by: Otavio Santana <[email protected]>
1 parent 3a83373 commit 3f6900f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

jnosql-oracle-nosql/src/test/java/org/eclipse/jnosql/databases/oracle/communication/OracleNoSQLDocumentManagerTest.java

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,27 @@ void shouldQueryParams(){
563563
assertThat(names).contains("Poliana");
564564
}
565565

566+
@Test
567+
void shouldInsertAndRetrieveWithEnum() {
568+
var entity = CommunicationEntity.of(COLLECTION_NAME);
569+
String id = UUID.randomUUID().toString();
570+
entity.add("_id", id);
571+
entity.add("name", "Test Name");
572+
entity.add("contact_type", ContactType.EMAIL);
573+
entityManager.insert(entity);
574+
575+
var query = select().from(COLLECTION_NAME)
576+
.where("_id").eq(id).build();
577+
Optional<CommunicationEntity> optional = entityManager.select(query).findFirst();
578+
SoftAssertions.assertSoftly(soft -> {);
579+
soft.assertThat(optional).isPresent();
580+
CommunicationEntity documentEntity = optional.get();
581+
soft.assertThat(documentEntity.find("name").orElseThrow().get(String.class)).isEqualTo("Test Name");
582+
soft.assertThat(documentEntity.find("contact_type").orElseThrow().get(ContactType.class))
583+
.isEqualTo(ContactType.EMAIL);
584+
});
585+
}
586+
566587
private CommunicationEntity createDocumentList() {
567588
var entity = CommunicationEntity.of("AppointmentBook");
568589
entity.add(Element.of("_id", new Random().nextInt()));

0 commit comments

Comments
 (0)