Last active
November 17, 2017 16:19
-
-
Save Romeh/c5c4ea5d079136fc7f30fa3c9e135098 to your computer and use it in GitHub Desktop.
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
@RunWith(SpringRunner.class) | |
@SpringBootTest(classes = AlertManagerApplication.class,webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) | |
@ActiveProfiles("INTEGRATION_TEST") | |
public class AlertManagerApplicationIT { | |
@LocalServerPort | |
private int port; | |
@Autowired | |
private TestRestTemplate template; | |
private URL base; | |
@Before | |
public void setUp() throws Exception { | |
this.base = new URL("http://localhost:" + port + "/"); | |
} | |
// then add your integration test which will include real started ignite server node whoch will be closed once the integration test is done | |
@Test | |
public void contextLoads() { | |
assertTrue(template.getForEntity(base+"/health",String.class).getStatusCode().is2xxSuccessful()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment