Skip to content

Commit c8a107e

Browse files
mpeelsMichael Peels
andauthored
Add health endpoint. Remove unnecessary semicolon (#334)
Co-authored-by: Michael Peels <michaelpeels@Michael-Peels.local>
1 parent 3afb96f commit c8a107e

4 files changed

Lines changed: 35 additions & 1 deletion

File tree

containers/db/initialize/restore.d/04-create-deduplication-db.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ CREATE TABLE match_candidates (
3636
person_uid bigint,
3737
mpi_person_id uniqueidentifier,
3838
date_identified DATETIME DEFAULT GETDATE(),
39-
is_merge BIT NULL;
39+
is_merge BIT NULL
4040
);
4141
GO
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package gov.cdc.nbs.deduplication.health;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.RestController;
5+
6+
@RestController
7+
public class HealthController {
8+
9+
@GetMapping("/health")
10+
public HealthResponse health() {
11+
return new HealthResponse("UP");
12+
}
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package gov.cdc.nbs.deduplication.health;
2+
3+
public record HealthResponse(String status) {
4+
5+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package gov.cdc.nbs.deduplication.health;
2+
3+
import org.junit.jupiter.api.Test;
4+
import static org.assertj.core.api.Assertions.assertThat;
5+
6+
class HealthControllerTest {
7+
8+
HealthController controller = new HealthController();
9+
10+
@Test
11+
void should_return_health() {
12+
HealthResponse response = controller.health();
13+
14+
assertThat(response.status()).isEqualTo("UP");
15+
}
16+
}

0 commit comments

Comments
 (0)