Skip to content

Commit

Permalink
added a hello at /
Browse files Browse the repository at this point in the history
  • Loading branch information
dashaun committed Dec 15, 2023
1 parent 1323b28 commit 60c8ef3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

Listens for webhook events from PubSubHubbub, then, does nothing, yet.

Respond to the subscription request:

operation::hello[snippets='httpie-request,response-body']

Check that the service is health:

operation::health[snippets='httpie-request']
operation::health[snippets='httpie-request,response-body']

Post the Atom XML event to the service:

operation::listen[snippets='httpie-request']
operation::listen[snippets='httpie-request,response-body']
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@ class YouTubeController {
String listen(@RequestBody String atomXml) {
logger.info("Received: " + atomXml);
return "OK";
}
}

@GetMapping(value = "/")
String hello(){
return "OK";
}
}
15 changes: 15 additions & 0 deletions src/test/java/com/javagrunt/listener/youtube/WebLayerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ void setUp(RestDocumentationContextProvider restDocumentation) {
.build();
}

@Test
public void getShouldReturnOk() {
given(this.spec)
.filter(document("hello",
preprocessRequest(modifyUris()
.scheme("https")
.host("youtube-listener.javagrunt.com")
.removePort())))
.when()
.port(this.port)
.get("/")
.then()
.assertThat().statusCode(is(200));
}

@Test
void postShouldReturnSuccess() throws Exception {
given(this.spec)
Expand Down

0 comments on commit 60c8ef3

Please sign in to comment.