diff --git a/pom.xml b/pom.xml index 14761aca..e2cbed82 100644 --- a/pom.xml +++ b/pom.xml @@ -198,8 +198,8 @@ 2.17 1.3.3.BUILD-SNAPSHOT - 1.3.0.BUILD-SNAPSHOT - 1.3.1.BUILD-SNAPSHOT + 1.2.3.BUILD-SNAPSHOT + 1.3.4.BUILD-SNAPSHOT diff --git a/spring-cloud-zookeeper-discovery/src/test/java/org/springframework/cloud/zookeeper/discovery/ZookeeperDiscoveryAutoRegistrationFalseTests.java b/spring-cloud-zookeeper-discovery/src/test/java/org/springframework/cloud/zookeeper/discovery/ZookeeperDiscoveryAutoRegistrationFalseTests.java index 943f25d9..64d5e2a5 100644 --- a/spring-cloud-zookeeper-discovery/src/test/java/org/springframework/cloud/zookeeper/discovery/ZookeeperDiscoveryAutoRegistrationFalseTests.java +++ b/spring-cloud-zookeeper-discovery/src/test/java/org/springframework/cloud/zookeeper/discovery/ZookeeperDiscoveryAutoRegistrationFalseTests.java @@ -16,6 +16,7 @@ package org.springframework.cloud.zookeeper.discovery; +import java.lang.reflect.Field; import java.util.List; import org.junit.Test; @@ -35,6 +36,7 @@ import org.springframework.context.annotation.Profile; import org.springframework.stereotype.Controller; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; +import org.springframework.util.ReflectionUtils; import org.springframework.web.bind.annotation.RequestMapping; import static org.assertj.core.api.BDDAssertions.then; @@ -58,7 +60,9 @@ public class ZookeeperDiscoveryAutoRegistrationFalseTests { //expect: then(discoveryClient).isInstanceOf(CompositeDiscoveryClient.class); CompositeDiscoveryClient composite = (CompositeDiscoveryClient) discoveryClient; - List discoveryClients = composite.getDiscoveryClients(); + Field field = ReflectionUtils.findField(CompositeDiscoveryClient.class, "discoveryClients"); + ReflectionUtils.makeAccessible(field); + List discoveryClients = (List) ReflectionUtils.getField(field, composite); DiscoveryClient first = discoveryClients.get(0); then(first).isInstanceOf(ZookeeperDiscoveryClient.class); }