diff --git a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/DocumentDatabase.java b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/DocumentDatabase.java index 7cdfbc124..5fbb6cd8c 100644 --- a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/DocumentDatabase.java +++ b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/DocumentDatabase.java @@ -61,10 +61,8 @@ public static void clearDatabase(String index) { try (var elasticsearch = INSTANCE.newElasticsearchClient()) { var response = elasticsearch.client().indices().delete(DeleteIndexRequest.of(d -> d.index(index))); - assertSoftly(softly -> { - softly.assertThat(response.acknowledged()) - .isTrue(); - }); + assertSoftly(softly -> softly.assertThat(response.acknowledged()) + .isTrue()); } catch (Exception e) { if( !(e instanceof ElasticsearchException)) { throw new RuntimeException(e); @@ -76,10 +74,8 @@ public static void createDatabase(String index) { try (var elasticsearch = INSTANCE.newElasticsearchClient()) { CreateIndexResponse response = elasticsearch.client().indices().create( CreateIndexRequest.of(b -> b.index(index))); - assertSoftly(softly -> { - softly.assertThat(response.acknowledged()) - .isTrue(); - }); + assertSoftly(softly -> softly.assertThat(response.acknowledged()) + .isTrue()); } catch (Exception e) { throw new RuntimeException(e); } @@ -88,10 +84,8 @@ public static void createDatabase(String index) { public static void updateMapping(String index, Function> fn) { try (var elasticsearch = INSTANCE.newElasticsearchClient()) { PutMappingResponse response = elasticsearch.client().indices().putMapping(fn); - assertSoftly(softly -> { - softly.assertThat(response.acknowledged()) - .isTrue(); - }); + assertSoftly(softly -> softly.assertThat(response.acknowledged()) + .isTrue()); } catch (Exception e) { throw new RuntimeException(e); } @@ -111,10 +105,8 @@ public static void insertData(String index, Map map) { IndexResponse response = elasticsearch.client().index(indexRequest); - assertSoftly(softly -> { - softly.assertThat(response.result().jsonValue()) - .isEqualTo("created"); - }); + assertSoftly(softly -> softly.assertThat(response.result().jsonValue()) + .isEqualTo("created")); _id.ifPresent(id -> map.put("_id", id)); } catch (Exception e) { throw new RuntimeException(e); diff --git a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/QueryConverterTest.java b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/QueryConverterTest.java index 0076bfeb6..d8c7c7ef5 100644 --- a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/QueryConverterTest.java +++ b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/communication/QueryConverterTest.java @@ -103,17 +103,13 @@ void testSupportTermQuery() throws Exception { .as("indexMappingRecordWithoutKeywordAttributes wasn't provided") .isNotNull(); - map.keySet().forEach(key -> { - softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithoutKeywordAttributes, key)) - .as("%s attribute should not support TermQuery".formatted(key)) - .isFalse(); - }); - - Set.of("doc2.data1", "doc2.data2").forEach(key -> { - softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithoutKeywordAttributes, key)) - .as("%s attribute should not support TermQuery".formatted(key)) - .isFalse(); - }); + map.keySet().forEach(key -> softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithoutKeywordAttributes, key)) + .as("%s attribute should not support TermQuery".formatted(key)) + .isFalse()); + + Set.of("doc2.data1", "doc2.data2").forEach(key -> softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithoutKeywordAttributes, key)) + .as("%s attribute should not support TermQuery".formatted(key)) + .isFalse()); }); @@ -136,12 +132,9 @@ void testSupportTermQuery() throws Exception { map.keySet().stream() .filter(anObject -> !"@entity".equals(anObject)) - .forEach(key -> { - softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithKeywordAttributes, key)) - .as("%s attribute should not support TermQuery".formatted(key)) - .isFalse(); - - }); + .forEach(key -> softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithKeywordAttributes, key)) + .as("%s attribute should not support TermQuery".formatted(key)) + .isFalse()); softly.assertThat(QueryConverter.supportTermQuery(indexMappingRecordWithKeywordAttributes, "@entity")) diff --git a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/integration/RepositoryIntegrationTest.java b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/integration/RepositoryIntegrationTest.java index 9a1c60f8d..c3d1f6aae 100644 --- a/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/integration/RepositoryIntegrationTest.java +++ b/jnosql-elasticsearch/src/test/java/org/eclipse/jnosql/databases/elasticsearch/integration/RepositoryIntegrationTest.java @@ -203,18 +203,14 @@ public void shouldFindByTitleLike() throws InterruptedException { return !books.isEmpty(); }); - assertSoftly(softly -> { - assertThat(booksWithEffective.get()) - .as("returned book list with 'Effective' is not equals to the expected items ") - .containsAll(effectiveBooks); - }); + assertSoftly(softly -> assertThat(booksWithEffective.get()) + .as("returned book list with 'Effective' is not equals to the expected items ") + .containsAll(effectiveBooks)); - assertSoftly(softly -> { - assertThat(booksWithJa.get()) - .as("returned book list with 'Ja*' is not equals to the expected items ") - .containsAll(allBooks); - }); + assertSoftly(softly -> assertThat(booksWithJa.get()) + .as("returned book list with 'Ja*' is not equals to the expected items ") + .containsAll(allBooks)); }