Skip to content

Commit 39c6f2f

Browse files
committed
test: update test on arango db to support the new keyworlds
Signed-off-by: Otavio Santana <[email protected]>
1 parent be87404 commit 39c6f2f

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

jnosql-arangodb/src/test/java/org/eclipse/jnosql/databases/arangodb/communication/ArangoDBDocumentManagerTest.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ void shouldFindContains() {
413413

414414
entityManager.insert(entity);
415415
var query = new MappingQuery(Collections.emptyList(), 0L, 0L, CriteriaCondition.contains(Element.of("name",
416-
"liana")), COLLECTION_NAME, Collections.emptyList());
416+
"lia")), COLLECTION_NAME, Collections.emptyList());
417417

418418
var result = entityManager.select(query).toList();
419419
SoftAssertions.assertSoftly(softly -> {
@@ -424,12 +424,32 @@ void shouldFindContains() {
424424

425425
@Test
426426
void shouldStartsWith() {
427+
var entity = getEntity();
428+
429+
entityManager.insert(entity);
430+
var query = new MappingQuery(Collections.emptyList(), 0L, 0L, CriteriaCondition.startsWith(Element.of("name",
431+
"Pol")), COLLECTION_NAME, Collections.emptyList());
427432

433+
var result = entityManager.select(query).toList();
434+
SoftAssertions.assertSoftly(softly -> {
435+
softly.assertThat(result).hasSize(1);
436+
softly.assertThat(result.get(0).find("name").orElseThrow().get(String.class)).isEqualTo("Poliana");
437+
});
428438
}
429439

430440
@Test
431441
void shouldEndsWith() {
442+
var entity = getEntity();
443+
444+
entityManager.insert(entity);
445+
var query = new MappingQuery(Collections.emptyList(), 0L, 0L, CriteriaCondition.endsWith(Element.of("name",
446+
"ana")), COLLECTION_NAME, Collections.emptyList());
432447

448+
var result = entityManager.select(query).toList();
449+
SoftAssertions.assertSoftly(softly -> {
450+
softly.assertThat(result).hasSize(1);
451+
softly.assertThat(result.get(0).find("name").orElseThrow().get(String.class)).isEqualTo("Poliana");
452+
});
433453
}
434454

435455
private CommunicationEntity getEntity() {

0 commit comments

Comments
 (0)