-
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.
DSND-3203: Make healthcheck private (#158)
* DSND-3203: Make healthcheck not public * DSND-3203: Address vulnerable deps * DSND-3203: Remove fixing vulnerable transitive dep * Upgrading this transitive dep breaks the service and is out of scope for this ticket. * Service needs a major refactor.
- Loading branch information
1 parent
8b250dd
commit 2a695ef
Showing
7 changed files
with
55 additions
and
33 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
14 changes: 0 additions & 14 deletions
14
src/main/java/uk/gov/companieshouse/pscdataapi/controller/HealthCheckController.java
This file was deleted.
Oops, something went wrong.
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
37 changes: 37 additions & 0 deletions
37
src/test/java/uk/gov/companieshouse/pscdataapi/PscDataApiApplicationIT.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,37 @@ | ||
package uk.gov.companieshouse.pscdataapi; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; | ||
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; | ||
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.api.function.Executable; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
import org.springframework.test.web.servlet.MockMvc; | ||
|
||
@AutoConfigureMockMvc | ||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) | ||
class PscDataApiApplicationIT { | ||
|
||
@Autowired | ||
private MockMvc mockMvc; | ||
|
||
@Test | ||
void shouldStartApplication() { | ||
Executable executable = () -> PscDataApiApplication.main(new String[0]); | ||
assertDoesNotThrow(executable); | ||
} | ||
|
||
@Test | ||
void shouldReturn200FromGetHealthEndpoint() throws Exception { | ||
this.mockMvc.perform(get("/healthcheck")) | ||
.andDo(print()) | ||
.andExpect(status().isOk()) | ||
.andExpect(content().string("{\"status\":\"UP\"}")); | ||
} | ||
} |
13 changes: 0 additions & 13 deletions
13
src/test/java/uk/gov/companieshouse/pscdataapi/PscDataApiApplicationTests.java
This file was deleted.
Oops, something went wrong.
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