From 019433a025f725b3119465a8ad8f9637fc3c5f3b Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Mon, 13 Jan 2020 15:35:24 +0100 Subject: [PATCH] WIP -- TODO MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * IT auf TestWebClient umstellen? MockMvc funktioniert nicht! * Commit für IT ordentlich beschreiben * RemoteContentRestController bei Einführung in RestController umbenennen ** Dort ordentlich die Scheidung text/html | text/plain umsetzen ** Dort Testfall kontrollieren * Danach: Commit für RestController nach IT-Test verschieben * Anpassung / Ergänzung des IT-Tests? --- ...ntController.java => RemoteContentRestController.java} | 7 ++++--- ...llerTest.java => RemoteContentRestControllerTest.java} | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) rename src/main/java/de/juplo/demo/{RemoteContentController.java => RemoteContentRestController.java} (70%) rename src/test/java/de/juplo/demo/{RemoteContentControllerTest.java => RemoteContentRestControllerTest.java} (80%) diff --git a/src/main/java/de/juplo/demo/RemoteContentController.java b/src/main/java/de/juplo/demo/RemoteContentRestController.java similarity index 70% rename from src/main/java/de/juplo/demo/RemoteContentController.java rename to src/main/java/de/juplo/demo/RemoteContentRestController.java index 422f5a6..312dd3f 100644 --- a/src/main/java/de/juplo/demo/RemoteContentController.java +++ b/src/main/java/de/juplo/demo/RemoteContentRestController.java @@ -1,6 +1,7 @@ package de.juplo.demo; +import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -12,18 +13,18 @@ import reactor.core.publisher.Mono; * @author Kai Moritz */ @RestController -public class RemoteContentController +public class RemoteContentRestController { RemoteContentService service; - public RemoteContentController(RemoteContentService service) + public RemoteContentRestController(RemoteContentService service) { this.service = service; } - @GetMapping("/") + @GetMapping(path = "/", produces = MediaType.TEXT_PLAIN_VALUE) public Mono fetch(@RequestParam String path) { return service.getRemoteText(path); diff --git a/src/test/java/de/juplo/demo/RemoteContentControllerTest.java b/src/test/java/de/juplo/demo/RemoteContentRestControllerTest.java similarity index 80% rename from src/test/java/de/juplo/demo/RemoteContentControllerTest.java rename to src/test/java/de/juplo/demo/RemoteContentRestControllerTest.java index fdba099..c034f0f 100644 --- a/src/test/java/de/juplo/demo/RemoteContentControllerTest.java +++ b/src/test/java/de/juplo/demo/RemoteContentRestControllerTest.java @@ -12,13 +12,13 @@ import reactor.core.publisher.Mono; /** - * Unit-Test for class {@link RemoteContentController}. + * Unit-Test for class {@link RemoteContentRestController}. * @author Kai Moritz */ @ExtendWith(SpringExtension.class) -public class RemoteContentControllerTest +public class RemoteContentRestControllerTest { - RemoteContentController controller; + RemoteContentRestController controller; RemoteContentService service; @@ -26,7 +26,7 @@ public class RemoteContentControllerTest void setUp() { service = Mockito.mock(RemoteContentService.class); - controller = new RemoteContentController(service); + controller = new RemoteContentRestController(service); } -- 2.20.1