You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jg...@apache.org on 2022/05/20 16:28:11 UTC
[nifi] branch main updated: NIFI-10043 fix ElasticsearchClient integration tests following JUnit5 upgrade; update Elasticsearch and json-path dependency versions
This is an automated email from the ASF dual-hosted git repository.
jgresock pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/main by this push:
new 9c9c708c14 NIFI-10043 fix ElasticsearchClient integration tests following JUnit5 upgrade; update Elasticsearch and json-path dependency versions
9c9c708c14 is described below
commit 9c9c708c14a29b4b7527a801ca1dfd243c923b32
Author: Chris Sampson <ch...@gmail.com>
AuthorDate: Fri May 20 12:54:45 2022 +0100
NIFI-10043 fix ElasticsearchClient integration tests following JUnit5 upgrade; update Elasticsearch and json-path dependency versions
Signed-off-by: Joe Gresock <jg...@gmail.com>
This closes #6062.
---
.../nifi-elasticsearch-client-service/pom.xml | 11 +++++------
.../integration/ElasticSearchClientService_IT.groovy | 19 ++++++++++---------
.../nifi-elasticsearch-restapi-processors/pom.xml | 2 +-
3 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml
index 4965fed0f3..cb95985347 100644
--- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml
+++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/pom.xml
@@ -135,7 +135,7 @@
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
- <version>2.6.0</version>
+ <version>2.7.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
@@ -187,7 +187,7 @@
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
- <version>3.6.3</version>
+ <version>3.8.5</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -210,8 +210,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
- <!-- use 3.0.0-M3 due to a classpath/class loader issue in -M5, expected to be fixed in M6+ -->
- <version>3.0.0-M3</version>
+ <version>3.0.0-M6</version>
</plugin>
</plugins>
</pluginManagement>
@@ -251,7 +250,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <es.int.version>7.17.1</es.int.version>
+ <es.int.version>7.17.3</es.int.version>
<es.int.script.name>setup-7.script</es.int.script.name>
<es.int.type.name />
<es.int.path.conf />
@@ -264,7 +263,7 @@
<activeByDefault>false</activeByDefault>
</activation>
<properties>
- <es.int.version>8.0.1</es.int.version>
+ <es.int.version>8.2.0</es.int.version>
<!-- elasticsearch-maven-plugin version 6.20+ required for Elasticsearch 8.x+ -->
<alexcojocaru.plugin.version>6.22</alexcojocaru.plugin.version>
<es.int.script.name>setup-8.script</es.int.script.name>
diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/groovy/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.groovy b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/groovy/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.groovy
index 26b46d687e..0997542af2 100644
--- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/groovy/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.groovy
+++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/test/groovy/org/apache/nifi/elasticsearch/integration/ElasticSearchClientService_IT.groovy
@@ -34,13 +34,14 @@ import org.apache.nifi.util.StringUtils
import org.apache.nifi.util.TestRunner
import org.apache.nifi.util.TestRunners
import org.junit.jupiter.api.AfterEach
-import org.junit.jupiter.api.Assumptions
import org.junit.jupiter.api.BeforeAll
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import static groovy.json.JsonOutput.prettyPrint
import static groovy.json.JsonOutput.toJson
+import static org.junit.jupiter.api.Assertions.assertNotEquals
+import static org.junit.jupiter.api.Assertions.assertThrows
import static org.junit.jupiter.api.Assumptions.assumeTrue
import static org.junit.jupiter.api.Assertions.assertEquals
@@ -83,7 +84,7 @@ class ElasticSearchClientService_IT {
@BeforeAll
static void beforeAll() throws Exception {
- Assumptions.assumeTrue(isElasticsearchSetup(), "Elasticsearch integration-tests not setup")
+ assumeTrue(isElasticsearchSetup(), "Elasticsearch integration-tests not setup")
System.out.println(
String.format("%n%n%n%n%n%n%n%n%n%n%n%n%n%n%nTYPE: %s%nVERSION: %s%nFLAVOUR %s%n%n%n%n%n%n%n%n%n%n%n%n%n%n%n",
@@ -119,7 +120,7 @@ class ElasticSearchClientService_IT {
throw ex
}
- service.refresh(null, null);
+ service.refresh(null, null)
}
@AfterEach
@@ -226,9 +227,9 @@ class ElasticSearchClientService_IT {
@Test
void testSearchWarnings() {
- Assume.assumeTrue("Requires version <8.0 (no search API deprecations yet for 8.x)", VERSION < ES_8_0)
+ assumeTrue(VERSION < ES_8_0, "Requires version <8.0 (no search API deprecations yet for 8.x)")
- String query
+ String query = null
String type = TYPE
if (VERSION.toString().startsWith("8.")) {
// TODO: something that's deprecated when the 8.x branch progresses to include search-API deprecations
@@ -287,11 +288,11 @@ class ElasticSearchClientService_IT {
assertNull(scrollResponse.searchAfter, "Unexpected Search_After")
assertNull(scrollResponse.pitId, "Unexpected pitId")
- assertNotEquals(scrollResponse.hits, response.hits, "Same results")
+ assertNotEquals(scrollResponse.hits, response.hits, () -> "Same results")
// delete the scroll
DeleteOperationResponse deleteResponse = service.deleteScroll(scrollResponse.scrollId)
- assertNotNull("Delete Response was null", deleteResponse)
+ assertNotNull(deleteResponse, "Delete Response was null")
assertTrue(deleteResponse.took > 0)
// delete scroll again (should now be unknown but the 404 caught and ignored)
@@ -638,7 +639,7 @@ class ElasticSearchClientService_IT {
doc.put("msg", "Buongiorno, mondo")
service.add(new IndexOperationRequest(INDEX, TYPE, TEST_ID, doc, IndexOperationRequest.Operation.Index), [refresh: "true"])
Map<String, Object> result = service.get(INDEX, TYPE, TEST_ID, null)
- assertEquals("Not the same", doc, result)
+ assertEquals(doc, result, "Not the same")
Map<String, Object> updates = new HashMap<>()
updates.put("from", "john.smith")
@@ -684,7 +685,7 @@ class ElasticSearchClientService_IT {
assert response.hasErrors()
assert response.items.findAll {
def key = it.keySet().stream().findFirst().get()
- it[key].containsKey("error")
+ (it[key] as Map<String, Object>).containsKey("error")
}.size() == 2
}
diff --git a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml
index fbd129666a..731c8584e2 100644
--- a/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml
+++ b/nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-restapi-processors/pom.xml
@@ -93,7 +93,7 @@ language governing permissions and limitations under the License. -->
<dependency>
<groupId>com.jayway.jsonpath</groupId>
<artifactId>json-path</artifactId>
- <version>2.6.0</version>
+ <version>2.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>