From 6cc8cb552e6a9adf0a5c70db18280f1baa01f1d9 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sat, 19 Sep 2020 10:11:41 +0200 Subject: [PATCH] Renamed and repackaged the example for the blog-article --- pom.xml | 8 ++++---- .../ExceptionHandlingApplication.java} | 6 +++--- .../ThymeleafController.java} | 6 +++--- .../ExceptionHandlingApplicationTests.java} | 7 +++---- 4 files changed, 13 insertions(+), 14 deletions(-) rename src/main/java/de/juplo/{ThymeleafTestApplication.java => demo/ExceptionHandlingApplication.java} (59%) rename src/main/java/de/juplo/{TestController.java => demo/ThymeleafController.java} (89%) rename src/test/java/de/juplo/{ThymeleafTestApplicationTests.java => demo/ExceptionHandlingApplicationTests.java} (90%) diff --git a/pom.xml b/pom.xml index 36cdb2f..e0b19e8 100644 --- a/pom.xml +++ b/pom.xml @@ -8,11 +8,11 @@ 2.3.4.RELEASE - de.juplo - thymeleafe-test + de.juplo.demo + exception-handling 0.0.1-SNAPSHOT - Thymeleaf-Test - Standalone version of the ThymeleafTest in http-resources + Testing Exception-Handling + Example-project, that showcases, how to test exception-handling in the springframework 11 diff --git a/src/main/java/de/juplo/ThymeleafTestApplication.java b/src/main/java/de/juplo/demo/ExceptionHandlingApplication.java similarity index 59% rename from src/main/java/de/juplo/ThymeleafTestApplication.java rename to src/main/java/de/juplo/demo/ExceptionHandlingApplication.java index aee3821..584f702 100644 --- a/src/main/java/de/juplo/ThymeleafTestApplication.java +++ b/src/main/java/de/juplo/demo/ExceptionHandlingApplication.java @@ -1,13 +1,13 @@ -package de.juplo; +package de.juplo.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -public class ThymeleafTestApplication { +public class ExceptionHandlingApplication { public static void main(String[] args) { - SpringApplication.run(ThymeleafTestApplication.class, args); + SpringApplication.run(ExceptionHandlingApplication.class, args); } } diff --git a/src/main/java/de/juplo/TestController.java b/src/main/java/de/juplo/demo/ThymeleafController.java similarity index 89% rename from src/main/java/de/juplo/TestController.java rename to src/main/java/de/juplo/demo/ThymeleafController.java index 5a4d148..f7b12ff 100644 --- a/src/main/java/de/juplo/TestController.java +++ b/src/main/java/de/juplo/demo/ThymeleafController.java @@ -1,4 +1,4 @@ -package de.juplo; +package de.juplo.demo; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,10 +12,10 @@ import org.springframework.web.bind.annotation.ResponseStatus; import org.thymeleaf.exceptions.TemplateInputException; @Controller -public class TestController +public class ThymeleafController { private final static Logger LOG = - LoggerFactory.getLogger(TestController.class); + LoggerFactory.getLogger(ThymeleafController.class); @RequestMapping("/controller.html") diff --git a/src/test/java/de/juplo/ThymeleafTestApplicationTests.java b/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java similarity index 90% rename from src/test/java/de/juplo/ThymeleafTestApplicationTests.java rename to src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java index adb1e24..71a415a 100644 --- a/src/test/java/de/juplo/ThymeleafTestApplicationTests.java +++ b/src/test/java/de/juplo/demo/ExceptionHandlingApplicationTests.java @@ -1,4 +1,4 @@ -package de.juplo; +package de.juplo.demo; import org.junit.jupiter.api.Test; import org.slf4j.Logger; @@ -8,7 +8,6 @@ import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMock import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.web.servlet.MockMvc; -import org.springframework.test.web.servlet.MvcResult; import java.net.URI; @@ -18,9 +17,9 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers. @SpringBootTest @AutoConfigureWebMvc @AutoConfigureMockMvc -class ThymeleafTestApplicationTests { +class ExceptionHandlingApplicationTests { private final static Logger LOG = - LoggerFactory.getLogger(ThymeleafTestApplicationTests.class); + LoggerFactory.getLogger(ExceptionHandlingApplicationTests.class); @Autowired MockMvc mvc; -- 2.20.1