I'm developing various services and these run on port 8080 by tomcat.
As the next services to be generated are not related to the services that have already been generated, the port was requested to be modified.
I found the class TomcatEmbeddedServletContainerFactory
that modifies the tomcat port by java.
I made this code to modify the port:
public class TestContext {
@Bean
public EmbeddedServletContainerFactory servletContainer() {
TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
factory.setPort(2020);
factory.addInitializers();
return factory;
}
}
The service runs normally and the port is being modified, but service mapping is not being done.
I wanted an example of how to use this class to do the mapping. At least what method do I have to use to do the mapping.