Skip to content

Instantly share code, notes, and snippets.

@Romeh
Last active November 17, 2017 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Romeh/c5c4ea5d079136fc7f30fa3c9e135098 to your computer and use it in GitHub Desktop.
Save Romeh/c5c4ea5d079136fc7f30fa3c9e135098 to your computer and use it in GitHub Desktop.
@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