-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d99d23
commit 9eee8a6
Showing
4 changed files
with
44 additions
and
1 deletion.
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
19 changes: 19 additions & 0 deletions
19
ehealthid-rp/src/main/java/com/oviva/ehealthid/relyingparty/ws/HealthEndpoint.java
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 @@ | ||
package com.oviva.ehealthid.relyingparty.ws; | ||
|
||
import jakarta.ws.rs.GET; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.MediaType; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
@Path("/health") | ||
public class HealthEndpoint { | ||
|
||
private static final String STATUS_UP = "{\"status\":\"UP\"}"; | ||
|
||
@GET | ||
public Response get() { | ||
// For now if this endpoint is reachable then the service is up. There is no hard dependency | ||
// that could be down. | ||
return Response.ok(STATUS_UP).type(MediaType.APPLICATION_JSON_TYPE).build(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
ehealthid-rp/src/test/java/com/oviva/ehealthid/relyingparty/ws/HealthEndpointTest.java
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,20 @@ | ||
package com.oviva.ehealthid.relyingparty.ws; | ||
|
||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
import jakarta.ws.rs.core.Response.Status; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class HealthEndpointTest { | ||
|
||
@Test | ||
void get() { | ||
var sut = new HealthEndpoint(); | ||
|
||
// when | ||
var res = sut.get(); | ||
|
||
// then | ||
assertEquals(Status.OK.getStatusCode(), res.getStatus()); | ||
} | ||
} |