-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for status endpoint and added README
- Loading branch information
1 parent
aafe220
commit a5c26a6
Showing
6 changed files
with
65 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
admin-server/src/test/kotlin/com/sphereon/oid/fed/ApplicationTests.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { | ||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
admin-server/src/test/kotlin/com/sphereon/oid/fed/StatusEndpointTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters