0

The integration test tries to connect to zookeeper, when I test my code with TestRestTemplate and spring-cloud-zookeeper-discovery dependency. If zookeeper is not running the test throws an exception.

Here is simple project where you can reproduce the problem https://github.com/DenisGlot/disable-zookeeper-when-testing

How can I make the test skip connecting to zookeeper part?

Dennis Gloss
  • 2,307
  • 4
  • 21
  • 27

1 Answers1

2

Added bootstrap.properties in test/java/resources and put there

spring.cloud.service-registry.auto-registration.enabled=false
spring.cloud.zookeeper.discovery.enabled=false
spring.cloud.zookeeper.discovery.register=false
Dennis Gloss
  • 2,307
  • 4
  • 21
  • 27