fix:fix discovery junit. (#725)

pull/715/head
Haotian Zhang 2 years ago committed by GitHub
parent a13ddc4c01
commit fe2155b57c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -13,3 +13,4 @@
- [Test: remote deprecated method in test](https://github.com/Tencent/spring-cloud-tencent/pull/706) - [Test: remote deprecated method in test](https://github.com/Tencent/spring-cloud-tencent/pull/706)
- [docs:update README.](https://github.com/Tencent/spring-cloud-tencent/pull/718) - [docs:update README.](https://github.com/Tencent/spring-cloud-tencent/pull/718)
- [Code optimization & correct comment](https://github.com/Tencent/spring-cloud-tencent/pull/722) - [Code optimization & correct comment](https://github.com/Tencent/spring-cloud-tencent/pull/722)
- [fix:fix discovery junit.](https://github.com/Tencent/spring-cloud-tencent/pull/725)

@ -32,6 +32,7 @@ import static com.tencent.polaris.test.common.Consts.SERVICE_PROVIDER;
import static java.util.Collections.singletonList; import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
@ -63,7 +64,8 @@ public class PolarisDiscoveryClientTest {
@Test @Test
public void testGetServices() { public void testGetServices() {
when(polarisServiceDiscovery.getServices()).thenReturn(singletonList(SERVICE_PROVIDER)); // when(polarisServiceDiscovery.getServices()).thenReturn(singletonList(SERVICE_PROVIDER));
doReturn(singletonList(SERVICE_PROVIDER)).when(polarisServiceDiscovery).getServices();
List<String> services = client.getServices(); List<String> services = client.getServices();

Loading…
Cancel
Save