From e013b049b6f699429803a7d34519ace321359540 Mon Sep 17 00:00:00 2001 From: Hallvard Traetteberg <hal@ntnu.no> Date: Tue, 20 Aug 2019 23:46:03 +0200 Subject: [PATCH] Fixed some formatting, and a bug introduced when renaming a method referenced in fxml --- .../src/main/resources/simpleex/ui/FileMenu.fxml | 2 +- .../src/test/java/simpleex/core/LatLongTest.java | 1 + .../src/test/java/simpleex/json/AbstractJsonTest.java | 8 ++++---- simpleexample/src/test/java/simpleex/ui/FxAppTest.java | 2 +- .../src/test/resources/simpleex/ui/FileMenu.fxml | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/simpleexample/src/main/resources/simpleex/ui/FileMenu.fxml b/simpleexample/src/main/resources/simpleex/ui/FileMenu.fxml index ffaf61d..61fbe58 100644 --- a/simpleexample/src/main/resources/simpleex/ui/FileMenu.fxml +++ b/simpleexample/src/main/resources/simpleex/ui/FileMenu.fxml @@ -17,7 +17,7 @@ <SeparatorMenuItem/> <Menu fx:id="importMenu" text="Import"> <MenuItem text="File..." onAction="#handleFileImportAction"/> - <MenuItem text="URL..." onAction="#handleURLImportAction"/> + <MenuItem text="URL..." onAction="#handleUrlImportAction"/> </Menu> </items> </Menu> diff --git a/simpleexample/src/test/java/simpleex/core/LatLongTest.java b/simpleexample/src/test/java/simpleex/core/LatLongTest.java index 2931ac3..6835774 100644 --- a/simpleexample/src/test/java/simpleex/core/LatLongTest.java +++ b/simpleexample/src/test/java/simpleex/core/LatLongTest.java @@ -22,6 +22,7 @@ public class LatLongTest { testLatLong(LatLong.valueOf("63.0; 10.0", ","), 63.0, 10.0); Assert.fail("Should throw IllegalArgumentException"); } catch (final IllegalArgumentException e) { + // ok } catch (final Exception e) { Assert.fail("Should throw IllegalArgumentException"); } diff --git a/simpleexample/src/test/java/simpleex/json/AbstractJsonTest.java b/simpleexample/src/test/java/simpleex/json/AbstractJsonTest.java index c6eb616..a9c32bd 100644 --- a/simpleexample/src/test/java/simpleex/json/AbstractJsonTest.java +++ b/simpleexample/src/test/java/simpleex/json/AbstractJsonTest.java @@ -23,14 +23,14 @@ public abstract class AbstractJsonTest { protected abstract ObjectMapper createObjectMapper(); - protected <T> SimpleModule createSimpleModule(final Class<T> clazz, + protected <T> ObjectMapper createObjectMapper(final Class<T> clazz, final JsonSerializer<T> serializer, final JsonDeserializer<T> deserializer) { - return new SimpleModule().addSerializer(clazz, serializer).addDeserializer(clazz, deserializer); + return new ObjectMapper().registerModule(createSimpleModule(clazz, serializer, deserializer)); } - protected <T> ObjectMapper createObjectMapper(final Class<T> clazz, + protected <T> SimpleModule createSimpleModule(final Class<T> clazz, final JsonSerializer<T> serializer, final JsonDeserializer<T> deserializer) { - return new ObjectMapper().registerModule(createSimpleModule(clazz, serializer, deserializer)); + return new SimpleModule().addSerializer(clazz, serializer).addDeserializer(clazz, deserializer); } protected void assertEqualsIgnoreWhitespace(final String expected, final String actual) diff --git a/simpleexample/src/test/java/simpleex/ui/FxAppTest.java b/simpleexample/src/test/java/simpleex/ui/FxAppTest.java index 02cd11b..0b3f7d1 100644 --- a/simpleexample/src/test/java/simpleex/ui/FxAppTest.java +++ b/simpleexample/src/test/java/simpleex/ui/FxAppTest.java @@ -60,7 +60,7 @@ public class FxAppTest extends ApplicationTest { latLongs = mock(LatLongs.class); // get nth LatLong object when(latLongs.getLatLong(anyInt())) - .then(invocation -> latLongList.get(invocation.getArgument(0))); + .then(invocation -> latLongList.get(invocation.getArgument(0))); // get the number of LatLong objects when(latLongs.getLatLongCount()).then(invocation -> latLongList.size()); // iterator for LatLong objects diff --git a/simpleexample/src/test/resources/simpleex/ui/FileMenu.fxml b/simpleexample/src/test/resources/simpleex/ui/FileMenu.fxml index ffaf61d..61fbe58 100644 --- a/simpleexample/src/test/resources/simpleex/ui/FileMenu.fxml +++ b/simpleexample/src/test/resources/simpleex/ui/FileMenu.fxml @@ -17,7 +17,7 @@ <SeparatorMenuItem/> <Menu fx:id="importMenu" text="Import"> <MenuItem text="File..." onAction="#handleFileImportAction"/> - <MenuItem text="URL..." onAction="#handleURLImportAction"/> + <MenuItem text="URL..." onAction="#handleUrlImportAction"/> </Menu> </items> </Menu> -- GitLab