Dennis Gloss
Dennis Gloss

Reputation: 2831

How to disable spring cloud zookeeper when executing integration test

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?

Upvotes: 0

Views: 2180

Answers (1)

Dennis Gloss
Dennis Gloss

Reputation: 2831

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

Upvotes: 2

Related Questions