I am running a simple Junit Testing a Controller in Spring Boot. The test code looks like this:
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfigu
Another solution is to disable the Eureka Client in your application.properties or application.yml file under test/resources
applications.properties:
eureka.client.enabled=false
application.yml:
eureka:
client:
enabled: false
This has the benefit of not needing to remeber to include the system property for every JUnit test that requires disabling the Eureka Client.