Im pretty new to spring framework and my JAVA application(Say Project_A) running at http://localhost:8080, does processing and forwards the processed content to http://localhost:9090 where another application(Say Project_B) is running. Project_B replies back to Project_A and then Project_A forwards the content outside .
Im now trying to write integration test for Project_A , so need two mocks, one at the request side and the other at Project_B side . For request, I can make use of MockMVC to simulate request and send . But for simulating the Project_B , Im thinking of creating a mock controller which receives requests from Project_A and send replies accordingly . So for that, I need to create another Controller running in different port . The default port in project_A is 8080 and in my new controller mock I need to use 9090.
Is there a way to use two different ports in one spring junit application ? Or any better way to achieve it with spring unit testing itself ?