commit 42939d086759a228c550adbf8b5d462f688a2a62
Author: Jakub Danek <jakub.danek@yoso.fi>
Date:   Tue Oct 8 13:31:03 2019 +0200

    re #37 code cleanup

diff --git a/server/src/main/java/org/danekja/ymanager/RESTConfiguration.java b/server/src/main/java/org/danekja/ymanager/RESTConfiguration.java
new file mode 100644
index 0000000..c171662
--- /dev/null
+++ b/server/src/main/java/org/danekja/ymanager/RESTConfiguration.java
@@ -0,0 +1,132 @@
+package org.danekja.ymanager;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
+import com.fasterxml.jackson.databind.module.SimpleModule;
+import com.fasterxml.jackson.databind.ser.std.StdSerializer;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+import java.io.IOException;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+import java.time.format.DateTimeFormatter;
+
+@Configuration
+public class RESTConfiguration implements WebMvcConfigurer {
+
+    @Override
+    public void addCorsMappings(CorsRegistry registry) {
+        registry.addMapping("/**")
+                .allowedMethods("GET", "POST", "PUT", "DELETE");
+    }
+
+    @Bean
+    public ObjectMapper objectMapper() {
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+        SimpleModule module = new SimpleModule();
+        module.addDeserializer(LocalDate.class, new LocalDateDeserializer());
+        module.addSerializer(LocalDate.class, new LocalDateSerializer());
+        module.addDeserializer(LocalTime.class, new LocalTimeDeserializer());
+        module.addSerializer(LocalTime.class, new LocalTimeSerializer());
+        module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
+        module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer());
+        mapper.registerModule(module);
+
+        return mapper;
+    }
+
+    class LocalDateDeserializer extends StdDeserializer<LocalDate> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+
+        LocalDateDeserializer() {
+            super(LocalDate.class);
+        }
+
+        @Override
+        public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
+            return LocalDate.parse(jsonParser.readValueAs(String.class), formatter);
+        }
+    }
+
+    class LocalDateSerializer extends StdSerializer<LocalDate> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
+
+        LocalDateSerializer() {
+            super(LocalDate.class);
+        }
+
+        @Override
+        public void serialize(LocalDate value, JsonGenerator generator, SerializerProvider provider) throws IOException {
+            generator.writeString(value.format(formatter));
+        }
+    }
+
+    class LocalTimeDeserializer extends StdDeserializer<LocalTime> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
+
+        LocalTimeDeserializer() {
+            super(LocalTime.class);
+        }
+
+        @Override
+        public LocalTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
+            return LocalTime.parse(jsonParser.readValueAs(String.class), formatter);
+        }
+    }
+
+    class LocalTimeSerializer extends StdSerializer<LocalTime> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
+
+        LocalTimeSerializer() {
+            super(LocalTime.class);
+        }
+
+        @Override
+        public void serialize(LocalTime value, JsonGenerator generator, SerializerProvider provider) throws IOException {
+            generator.writeString(value.format(formatter));
+        }
+    }
+
+    class LocalDateTimeSerializer extends StdSerializer<LocalDateTime> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
+
+        LocalDateTimeSerializer() {
+            super(LocalDateTime.class);
+        }
+
+        @Override
+        public void serialize(LocalDateTime value, JsonGenerator generator, SerializerProvider provider) throws IOException {
+            generator.writeString(value.format(formatter));
+        }
+    }
+
+    class LocalDateTimeDeserializer extends StdDeserializer<LocalDateTime> {
+
+        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
+
+        LocalDateTimeDeserializer() {
+            super(LocalDateTime.class);
+        }
+
+        @Override
+        public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
+            return LocalDateTime.parse(jsonParser.readValueAs(String.class), formatter);
+        }
+    }
+}
diff --git a/server/src/main/java/org/danekja/ymanager/ws/rest/RESTConfiguration.java b/server/src/main/java/org/danekja/ymanager/ws/rest/RESTConfiguration.java
deleted file mode 100644
index 7407651..0000000
--- a/server/src/main/java/org/danekja/ymanager/ws/rest/RESTConfiguration.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package org.danekja.ymanager.ws.rest;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonParser;
-import com.fasterxml.jackson.databind.DeserializationContext;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
-import com.fasterxml.jackson.databind.module.SimpleModule;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.CorsRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
-
-import java.io.IOException;
-import java.time.LocalDate;
-import java.time.LocalDateTime;
-import java.time.LocalTime;
-import java.time.format.DateTimeFormatter;
-
-@Configuration
-public class RESTConfiguration implements WebMvcConfigurer {
-
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-        registry.addMapping("/**")
-                .allowedMethods("GET", "POST", "PUT", "DELETE");
-    }
-
-    @Bean
-    public ObjectMapper objectMapper() {
-        ObjectMapper mapper = new ObjectMapper();
-        mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-
-        SimpleModule module = new SimpleModule();
-        module.addDeserializer(LocalDate.class, new LocalDateDeserializer());
-        module.addSerializer(LocalDate.class, new LocalDateSerializer());
-        module.addDeserializer(LocalTime.class, new LocalTimeDeserializer());
-        module.addSerializer(LocalTime.class, new LocalTimeSerializer());
-        module.addSerializer(LocalDateTime.class, new LocalDateTimeSerializer());
-        module.addDeserializer(LocalDateTime.class, new LocalDateTimeDeserializer());
-        mapper.registerModule(module);
-
-        return mapper;
-    }
-
-    class LocalDateDeserializer extends StdDeserializer<LocalDate> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-
-        LocalDateDeserializer() {
-            super(LocalDate.class);
-        }
-
-        @Override
-        public LocalDate deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
-            return LocalDate.parse(jsonParser.readValueAs(String.class), formatter);
-        }
-    }
-
-    class LocalDateSerializer extends StdSerializer<LocalDate> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd");
-
-        LocalDateSerializer() {
-            super(LocalDate.class);
-        }
-
-        @Override
-        public void serialize(LocalDate value, JsonGenerator generator, SerializerProvider provider) throws IOException {
-            generator.writeString(value.format(formatter));
-        }
-    }
-
-    class LocalTimeDeserializer extends StdDeserializer<LocalTime> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
-
-        LocalTimeDeserializer() {
-            super(LocalTime.class);
-        }
-
-        @Override
-        public LocalTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
-            return LocalTime.parse(jsonParser.readValueAs(String.class), formatter);
-        }
-    }
-
-    class LocalTimeSerializer extends StdSerializer<LocalTime> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("HH:mm");
-
-        LocalTimeSerializer() {
-            super(LocalTime.class);
-        }
-
-        @Override
-        public void serialize(LocalTime value, JsonGenerator generator, SerializerProvider provider) throws IOException {
-            generator.writeString(value.format(formatter));
-        }
-    }
-
-    class LocalDateTimeSerializer extends StdSerializer<LocalDateTime> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
-
-        LocalDateTimeSerializer() {
-            super(LocalDateTime.class);
-        }
-
-        @Override
-        public void serialize(LocalDateTime value, JsonGenerator generator, SerializerProvider provider) throws IOException {
-            generator.writeString(value.format(formatter));
-        }
-    }
-
-    class LocalDateTimeDeserializer extends StdDeserializer<LocalDateTime> {
-
-        private final DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy/MM/dd HH:mm:ss");
-
-        LocalDateTimeDeserializer() {
-            super(LocalDateTime.class);
-        }
-
-        @Override
-        public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException {
-            return LocalDateTime.parse(jsonParser.readValueAs(String.class), formatter);
-        }
-    }
-}
diff --git a/server/src/main/java/org/danekja/ymanager/ws/rest/TestController.java b/server/src/main/java/org/danekja/ymanager/ws/rest/TestController.java
deleted file mode 100644
index 4576fdb..0000000
--- a/server/src/main/java/org/danekja/ymanager/ws/rest/TestController.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.danekja.ymanager.ws.rest;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-import static org.springframework.web.bind.annotation.RequestMethod.GET;
-
-@RestController
-public class TestController {
-
-    @RequestMapping(value = "/test", method=GET)
-    public String hello() {
-        return "It works!!";
-    }
-}
