BAEL-3253: Use a random port number for Tomcat (#8351)
* BAEL-3253: Use a random port number for Tomcat * BAEL-3253: Validate a port availability
This commit is contained in:
committed by
Grzegorz Piwowarek
parent
1f0ab8ba5b
commit
f9f1534394
+2
-1
@@ -37,7 +37,8 @@ public class ProgrammaticTomcatIntegrationTest {
|
||||
@Test
|
||||
public void givenTomcatStarted_whenAccessServlet_responseIsTestAndResponseHeaderIsSet() throws Exception {
|
||||
CloseableHttpClient httpClient = HttpClientBuilder.create().build();
|
||||
HttpGet getServlet = new HttpGet("http://localhost:8080/my-servlet");
|
||||
String uri = "http://localhost:" + tomcat.getPort() + "/my-servlet";
|
||||
HttpGet getServlet = new HttpGet(uri);
|
||||
|
||||
HttpResponse response = httpClient.execute(getServlet);
|
||||
assertEquals(HttpStatus.SC_OK, response.getStatusLine().getStatusCode());
|
||||
|
||||
Reference in New Issue
Block a user