Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/maven/org.openrefine-main-3.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-berlin-wmse authored Jul 4, 2024
2 parents c26d3b9 + 5d70182 commit 2eb1fb9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
24 changes: 12 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

<properties>
<openrefine.version>3.8.1</openrefine.version>
<jackson.version>2.12.3</jackson.version>
<jackson.version>2.17.1</jackson.version>
<wdtk.version>0.12.1-SNAPSHOT</wdtk.version>
<swc-parser-lazy.version>3.1.9</swc-parser-lazy.version>
<surefire.version>2.22.2</surefire.version>
<surefire.version>3.2.5</surefire.version>
</properties>

<build>
Expand All @@ -34,7 +34,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand All @@ -45,7 +45,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
<configuration>
<encoding>UTF-8</encoding>
</configuration>
Expand All @@ -63,7 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.2</version>
<version>3.6.1</version>
<executions>
<execution>
<phase>compile</phase>
Expand All @@ -80,7 +80,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<version>3.3.2</version>
<configuration>
<filesets>
<fileset>
Expand All @@ -91,7 +91,7 @@
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<version>3.7.1</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
Expand Down Expand Up @@ -145,7 +145,7 @@
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.30</version>
<version>2.0.13</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -157,27 +157,27 @@
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>4.9.1</version>
<version>4.12.0</version>
</dependency>

<!-- testing dependencies -->

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>7.4.0</version>
<version>7.10.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>mockwebserver</artifactId>
<version>4.9.1</version>
<version>4.12.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>3.6.28</version>
<version>5.12.0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Iterator;
import java.util.List;

import com.fasterxml.jackson.core.JsonParser.Feature;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

Expand Down Expand Up @@ -68,7 +69,9 @@ public List<List<String>> getRelatedCategories(List <FileRecord> fileRecordOrigi
.addQueryParameter("format", "json").build();
Request request = new Request.Builder().url(urlRelatedCategoriesBase).build();
Response response = client.newCall(request).execute();
JsonNode jsonNode = new ObjectMapper().readTree(response.body().string());
JsonNode jsonNode = new ObjectMapper().enable(
Feature.INCLUDE_SOURCE_IN_LOCATION)
.readTree(response.body().string());
List<JsonNode> relatedCategories = new ArrayList<>();
List<List<String>> toCategoriesColumn = new ArrayList<>();
for (int i = 0; i < fileRecordOriginal.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public void testNextError() throws Exception {
Assert.assertFalse(rcf.hasNext());
String error = "Could not fetch related categories: Unexpected character ('{' (code 123)): was expecting double-quote to start field name"
+ "\n at [Source: (String)\"{\"batchcomplete\":\"\",\"query\":{\"pages\":{\"127723\":{\"pageid\":127723,\"ns\":6,"
+ "\"title\":\"File:LasTres_2.jpg\",{\"ns\":14,\"title\":\"Category:Cute dogs\"},{\"ns\":14,\"title\":\"Category:Costa Rican dogs\"}]}}}}\"; line: 1, column: 102]";
+ "\"title\":\"File:LasTres_2.jpg\",{\"ns\":14,\"title\":\"Category:Cute dogs\"},{\"ns\":14,\"title\":\"Category:Costa Rican dogs\"}]}}}}\"; line: 1, column: 101]";
List<String> categories = Arrays.asList("Category:Costa Rica", "Category:Cute dogs", "Category:Costa Rican dogs");
FileRecord file0 = new FileRecord("File:LasTres_2.jpg", "127723", null, error);
FileRecord file1 = new FileRecord("File:LasTres.jpg", "127722", categories, null);
Expand Down

0 comments on commit 2eb1fb9

Please sign in to comment.