Skip to content

Commit

Permalink
CID-1650 Expose actuator health endpoint (#63)
Browse files Browse the repository at this point in the history
CID-1650 Expose actuator health endpoint
  • Loading branch information
geoandri committed Jun 9, 2023
1 parent 174b944 commit ef9c583
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ Should there be any open questions feel free to open an [issue](https://github.c
1. The integration (vsm-github-broker) is packaged as a docker container which shall be deployed on the customer premises

2. The container runs a live service, which runs continuously
- it exposes a health endpoint on path `/actuator/health` which can be used to check the health of the service

3. On startup:
- the service will reach out to VSM to fetch the configured GitHub organizations
Expand All @@ -175,7 +176,7 @@ Should there be any open questions feel free to open an [issue](https://github.c

- to account for any intermittent interruptions (e.g. network issues, docker container failure etc.) between the agent and the GitHub instance, the service will do a full scan every week to ensure eventual consistency in VSM

5. After collecting the GitHub data (either by a full scan or by webhooks) the service relays the service data to the VSM workspace via REST API calls
5. After collecting the GitHub data (either by a full scan or by webhooks) the service relays the service data to the VSM workspace via REST API calls


The docker container as well as the source code is scanned daily with snyk to check for known vulnerabilities.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.cloud:spring-cloud-starter-openfeign")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.security:spring-security-oauth2-client:5.7.5")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package net.leanix.vsm.githubbroker.health

import com.github.tomakehurst.wiremock.client.WireMock
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock
import org.springframework.test.web.servlet.MockMvc
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders
import org.springframework.test.web.servlet.result.MockMvcResultMatchers
import org.springframework.test.web.servlet.setup.MockMvcBuilders
import org.springframework.web.context.WebApplicationContext

@SpringBootTest
@AutoConfigureWireMock(port = 6666)
class HealthEndpointTest {

@Autowired
private lateinit var context: WebApplicationContext

internal lateinit var mockMvc: MockMvc

@BeforeEach
fun setup() {
mockMvc = MockMvcBuilders
.webAppContextSetup(context)
.build()
WireMock.resetAllRequests()
}

@Test
fun `it responds with http status ok`() {
mockMvc.perform(
MockMvcRequestBuilders.get("/actuator/health")
)
.andExpect(MockMvcResultMatchers.status().isOk)
}
}

0 comments on commit ef9c583

Please sign in to comment.