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