I'm developing a simple api with three endpoints using vertx
.
That api has some predefined tests that I cannot modify and I need to pass, which use:
@Autowired
private GenericWebApplicationContext webApplicationContext;
private MockMvc mockMvc;
After finishing the api I found that as I'm using verticles I don't need the embedded tomcat which provides spring boot starter dependency, so I removed it.
Which is my problem?
I cannot exclude embedded tomcat because spring boot needs it, otherwise I will get the following error: The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured.
as vertx verticle and tomcat listen to the same port (8080).
The problem here is that I can change verticle port to 8081 for example, but the tests will need to be executed to the port 8080. How can I fix that, so that tests listen for verticle that I deploy (which creates an http server too)?
Basically I would like to know if it possible that MockHttpServletResponse
uses vertx server which is created by verticle instead of embedded tomcat.