Last active
September 25, 2019 09:25
-
-
Save simonrenoult/e6fd7d08e3c9e1319d129bf0886319c8 to your computer and use it in GitHub Desktop.
Revisions
-
simonrenoult revised this gist
Sep 25, 2019 . 3 changed files with 55 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ @RestController public class HealthcheckApi { private final SayImAlive sayImAlive; public HealthcheckApi(SayImAlive sayImAlive) { this.sayImAlive = sayImAlive; } @RequestMapping(value = "/healthcheck") public Boolean healthcheck() { return sayImAlive.execute(); } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,29 @@ package com.octo.skool13.infra; import org.junit.Test; import org.junit.runner.RunWith; 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.test.context.junit4.SpringRunner; import org.springframework.test.web.servlet.MockMvc; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @RunWith(SpringRunner.class) @SpringBootTest @AutoConfigureMockMvc public class HealthcheckApiTest { @Autowired private MockMvc mvc; @Test public void isAlive() throws Exception { mvc.perform(MockMvcRequestBuilders.get("/healthcheck")) .andExpect(status().isOk()) .andExpect(content().string("true")); } } This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ package com.octo.skool13; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ManageoApplication { public static void main(String[] args) { SpringApplication.run(ManageoApplication.class, args); } } -
simonrenoult created this gist
Sep 25, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ plugins { id 'java' id 'idea' id 'org.springframework.boot' version '2.1.8.RELEASE' id 'io.spring.dependency-management' version '1.0.8.RELEASE' } group 'com.octo.skool13' sourceCompatibility = 11 repositories { mavenCentral() } dependencies { // Web implementation 'org.springframework.boot:spring-boot-starter-web' // Tests testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation 'junit:junit:4.12' }