Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/oidf 45 status endpoint #5

Merged
merged 6 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fleet/run.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "gradle",
"workingDir": "$PROJECT_DIR$",
"tasks": [
":server:build"
":admin-server:build"
],
"args": [
""
Expand Down
19 changes: 19 additions & 0 deletions admin-server/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Admin server

API
<br>
```/status``` - To check health status

<br>

To build
<br>
```./gradlew admin-server:build```

To run
<br>
```./gradlew admin-server:bootRun```

To run tests
<br>
```./gradlew admin-server:test```
7 changes: 6 additions & 1 deletion admin-server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation(libs.springboot.actuator)
implementation(libs.springboot.web)
implementation(libs.kotlin.reflect)

testImplementation(libs.springboot.test)
runtimeOnly(libs.springboot.devtools)
}

Expand All @@ -31,4 +31,9 @@ kotlin {

tasks.withType<Test> {
useJUnitPlatform()
testLogging {
setExceptionFormat("full")
events("started", "skipped", "passed", "failed")
showStandardStreams = true
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.sphereon.oid.fed

import org.junit.jupiter.api.Test
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
class ApplicationTests {

@Test
fun contextLoads() {
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.sphereon.oid.fed

import org.junit.jupiter.api.Test
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.web.servlet.MockMvc
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get
import org.springframework.test.web.servlet.result.MockMvcResultMatchers.*


@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureMockMvc
class StatusEndpointTest {

@Autowired
private lateinit var mockMvc: MockMvc

@Test
fun testStatusEndpoint() {
mockMvc.perform(get("/status"))
.andExpect(status().isOk())
.andExpect(jsonPath("$.status").value("UP"))
}
}
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" }
springboot-actuator = { group = "org.springframework.boot", name = "spring-boot-starter-actuator" }
springboot-web = { group = "org.springframework.boot", name = "spring-boot-starter-web" }
springboot-devtools = { group = "org.springframework.boot", name = "spring-boot-devtools" }
springboot-test = { group = "org.springframework.boot", name = "spring-boot-starter-test" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
Expand Down
Loading