Open aravinth2094 opened 4 years ago
Hi Aravinth,
Microservices should be independent as it always be loose coupling. There will be 'N' number of Microservices in the project. In order to execute the JUnit test cases properly, we can follow below approaches.
To execute JUnit test cases properly for the client services, you should start parent services (discovery, configserver,...) before Client services get executed.
Using docker setup in your local environment, and add images to the docker during build. You have to be required to use "docker-maven-plugin" in both server and client. Please check the below URL for more information. https://github.com/sanjayvacharya/sleeplessinslc/tree/master/product-gateway-docker
For more information on Microservices testing strategies https://www.freecodecamp.org/news/these-are-the-most-effective-microservice-testing-strategies-according-to-the-experts-6fb584f2edde/
Hi Aravinth,
Microservices should be independent as it always be loose coupling. There will be 'N' number of Microservices in the project. In order to execute the JUnit test cases properly, we can follow below approaches.
Approach 1: (Might be you already aware of it)
To execute JUnit test cases properly for the client services, you should start parent services (discovery, configserver,...) before Client services get executed.
Approach 2:
Using docker setup in your local environment, and add images to the docker during build. You have to be required to use "docker-maven-plugin" in both server and client. Please check the below URL for more information. https://github.com/sanjayvacharya/sleeplessinslc/tree/master/product-gateway-docker
For more information on Microservices testing strategies https://www.freecodecamp.org/news/these-are-the-most-effective-microservice-testing-strategies-according-to-the-experts-6fb584f2edde/
Hi @venkatrs-ch197,
Yes I did succeed in green test cases by running dependent services before hand, but my goal is to automate it using pom.xml plugins, so that the parent pom.xml will perform safe integration test even if one service is changed.
I really don't think I want to go as far as spawning a whole docker container in a remote VM just to run my JUnit test cases, however the links that you sent are intriguing, will check them out thanks.
Describe the bug The JUnit test cases are not properly executing (although a workaround has been made to force-success them) due to lack of module dependency. For instance, the discovery server and the config server has to be up and running in order for the rest of the services to be running test cases smoothly
To Reproduce Steps to reproduce the behavior:
Expected behavior Need to be built with dependent modules
Screenshots NA
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context NA