Skip to content

Instantly share code, notes, and snippets.

@Romeh
Last active Nov 17, 2017
Embed
What would you like to do?
@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