From 39998fbf84e51c2b68053ab99e42875bdf8def54 Mon Sep 17 00:00:00 2001 From: dashaun Date: Sun, 17 Dec 2023 20:51:38 -0600 Subject: [PATCH] move docs to root, move endpoints to /api --- pom.xml | 2 +- src/main/java/com/javagrunt/listener/youtube/Application.java | 1 + .../java/com/javagrunt/listener/youtube/WebLayerTest.java | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 3a15671..8b297c1 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ copy-resources - ${project.build.outputDirectory}/static/docs + ${project.build.outputDirectory}/static/ ${project.build.directory}/generated-docs diff --git a/src/main/java/com/javagrunt/listener/youtube/Application.java b/src/main/java/com/javagrunt/listener/youtube/Application.java index 9bd04af..96caa4a 100644 --- a/src/main/java/com/javagrunt/listener/youtube/Application.java +++ b/src/main/java/com/javagrunt/listener/youtube/Application.java @@ -16,6 +16,7 @@ public static void main(String[] args) { } @RestController +@RequestMapping("/api") class YouTubeController { Logger logger = LoggerFactory.getLogger(YouTubeController.class); diff --git a/src/test/java/com/javagrunt/listener/youtube/WebLayerTest.java b/src/test/java/com/javagrunt/listener/youtube/WebLayerTest.java index d5b2b33..4f4f43f 100644 --- a/src/test/java/com/javagrunt/listener/youtube/WebLayerTest.java +++ b/src/test/java/com/javagrunt/listener/youtube/WebLayerTest.java @@ -45,7 +45,7 @@ public void getShouldEchoHubChallenge() { .removePort()))) .when() .port(this.port) - .get("/?hub.mode=subscribe&hub.challenge=CHALLENGE_STRING&hub.topic=somthingcool") + .get("/api/?hub.mode=subscribe&hub.challenge=CHALLENGE_STRING&hub.topic=somthingcool") .then() .assertThat().statusCode(is(200)) .assertThat().body(is("CHALLENGE_STRING")); @@ -63,7 +63,7 @@ void postShouldReturnSuccess() throws Exception { .body(exampleEvent) .when() .port(this.port) - .post("/") + .post("/api/") .then() .assertThat() .statusCode(is(200));