Skip to content

Commit

Permalink
add config for zipkin endpoint, add /actuator/info test
Browse files Browse the repository at this point in the history
  • Loading branch information
dashaun committed Dec 18, 2023
1 parent 9e24164 commit bceae6a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

- Go to [PubSubHubbub Hub](https://pubsubhubbub.appspot.com/subscribe)
- Enter the following details:
- Callback URL: We used [https://youtube-listener.javagrunt.com/]
- Callback URL: We used [https://youtube-listener.javagrunt.com]
- Topic URL: https://www.youtube.com/xml/feeds/videos.xml?channel_id=YOUR_CHANNEL_ID
- Mode: Subscribe

Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-redis</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
4 changes: 4 additions & 0 deletions src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Check that the service is health:

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

Check the application information:

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

Post the Atom XML event to the service:

operation::listen[snippets='httpie-request,response-body']
4 changes: 4 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
management.endpoint.info.enabled=true
management.endpoints.web.exposure.include=health,metrics,prometheus,loggers,info
management.zipkin.tracing.endpoint=${ZIPKIN_ENDPOINT:http://localhost:9411/api/v2/spans}

spring.mvc.problemdetails.enabled=true

#youtube.channel.id=${CHANNEL_ID:REPLACE_WITH_YOUR_CHANNEL_ID}
#youtube.listener.url=${LISTENER_URL:REPLACE_WITH_YOUR_URL}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ GenericContainer<?> zipkinContainer() {
return new GenericContainer<>(DockerImageName.parse("openzipkin/zipkin:latest")).withExposedPorts(9411);
}

// @Bean
// @ServiceConnection(name = "redis")
// GenericContainer<?> redisContainer() {
// return new GenericContainer<>(DockerImageName.parse("redis:latest")).withExposedPorts(6379);
// }


public static void main(String[] args) {
SpringApplication.from(Application::main).with(TestApplication.class).run(args);
}
Expand Down
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 @@ -83,6 +83,21 @@ public void actuatorHealth() {
.then()
.assertThat().statusCode(is(200));
}

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

private String exampleEvent = """
<feed xmlns:yt="http://www.youtube.com/xml/schemas/2015"
Expand Down

0 comments on commit bceae6a

Please sign in to comment.