From f0fd4ee223ee6f641d8289359884f53f6d215f74 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Mon, 14 Aug 2023 02:11:10 +0000 Subject: [PATCH 1/2] chore(deps): update dependency org.mockito:mockito-core to v5 --- server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/pom.xml b/server/pom.xml index 027eba2ff..b1db147fb 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -18,7 +18,7 @@ 4.4.4 5.9.3 3.24.2 - 4.11.0 + 5.4.0 2.0.7 11 11 From 44792d3d04fbf61eb9295eaf206beb88fed0bec4 Mon Sep 17 00:00:00 2001 From: Guillaume Grossetie Date: Sun, 20 Aug 2023 10:49:31 +0200 Subject: [PATCH 2/2] Use type on ArgumentMatcher for varargs https://github.com/mockito/mockito/wiki/Draft-Mockito-5-release-notes#what-is-the-effect-of-this-new-method --- .../java/io/kroki/server/service/GraphVizServiceTest.java | 2 +- .../test/java/io/kroki/server/service/PikchrServiceTest.java | 2 +- .../test/java/io/kroki/server/service/VegaServiceTest.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/server/src/test/java/io/kroki/server/service/GraphVizServiceTest.java b/server/src/test/java/io/kroki/server/service/GraphVizServiceTest.java index 67cca23e1..54f593304 100644 --- a/server/src/test/java/io/kroki/server/service/GraphVizServiceTest.java +++ b/server/src/test/java/io/kroki/server/service/GraphVizServiceTest.java @@ -22,7 +22,7 @@ public class GraphVizServiceTest { public void should_call_graphviz_with_correct_arguments() throws Throwable { Vertx vertx = Vertx.vertx(); Commander commanderMock = mock(Commander.class); - when(commanderMock.execute(any(), any())).thenReturn("graphviz".getBytes()); + when(commanderMock.execute(any(), any(String[].class))).thenReturn("graphviz".getBytes()); HashMap config = new HashMap<>(); config.put("KROKI_SAFE_MODE", "unsafe"); config.put("KROKI_DOT_BIN_PATH", "/path/to/dot"); diff --git a/server/src/test/java/io/kroki/server/service/PikchrServiceTest.java b/server/src/test/java/io/kroki/server/service/PikchrServiceTest.java index 4699ad452..799a4256d 100644 --- a/server/src/test/java/io/kroki/server/service/PikchrServiceTest.java +++ b/server/src/test/java/io/kroki/server/service/PikchrServiceTest.java @@ -22,7 +22,7 @@ public class PikchrServiceTest { public void should_call_pikchr_with_correct_arguments() throws Throwable { Vertx vertx = Vertx.vertx(); Commander commanderMock = mock(Commander.class); - when(commanderMock.execute(any(), any())).thenReturn("pikchr".getBytes()); + when(commanderMock.execute(any(), any(String[].class))).thenReturn("pikchr".getBytes()); HashMap config = new HashMap<>(); config.put("KROKI_SAFE_MODE", "unsafe"); config.put("KROKI_PIKCHR_BIN_PATH", "/path/to/pikchr"); diff --git a/server/src/test/java/io/kroki/server/service/VegaServiceTest.java b/server/src/test/java/io/kroki/server/service/VegaServiceTest.java index b6d5b28c8..7c72359c0 100644 --- a/server/src/test/java/io/kroki/server/service/VegaServiceTest.java +++ b/server/src/test/java/io/kroki/server/service/VegaServiceTest.java @@ -22,7 +22,7 @@ public class VegaServiceTest { public void should_call_vega_with_correct_arguments() throws Throwable { Vertx vertx = Vertx.vertx(); Commander commanderMock = mock(Commander.class); - when(commanderMock.execute(any(), any())).thenReturn("vega".getBytes()); + when(commanderMock.execute(any(), any(String[].class))).thenReturn("vega".getBytes()); HashMap config = new HashMap<>(); config.put("KROKI_SAFE_MODE", "unsafe"); config.put("KROKI_VEGA_BIN_PATH", "/path/to/vega"); @@ -45,7 +45,7 @@ public void should_call_vega_with_correct_arguments() throws Throwable { public void should_call_vega_lite_with_correct_arguments() throws Throwable { Vertx vertx = Vertx.vertx(); Commander commanderMock = mock(Commander.class); - when(commanderMock.execute(any(), any())).thenReturn("vega-lite".getBytes()); + when(commanderMock.execute(any(), any(String[].class))).thenReturn("vega-lite".getBytes()); HashMap config = new HashMap<>(); config.put("KROKI_SAFE_MODE", "unsafe"); config.put("KROKI_VEGA_BIN_PATH", "/path/to/vega");