fix break changes

pull/875/head
seanyu 3 years ago
parent 490b4d190e
commit 53b28e4cd3

@ -50,6 +50,13 @@
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

@ -65,7 +65,7 @@ public class PolarisServiceDiscovery {
serviceId = DiscoveryUtil.rewriteServiceId(serviceId);
List<ServiceInstance> instances = new ArrayList<>();
InstancesResponse filteredInstances = polarisDiscoveryHandler.getHealthyInstances(serviceId);
ServiceInstances serviceInstances = filteredInstances.getServiceInstances();
ServiceInstances serviceInstances = filteredInstances.toServiceInstances();
for (Instance instance : serviceInstances.getInstances()) {
instances.add(new PolarisServiceInstance(instance));
}

@ -77,6 +77,6 @@ public class PolarisDiscoveryEndpoint {
private ServiceInstances getServiceInstances(String serviceId) {
InstancesResponse instancesResponse = polarisDiscoveryHandler.getHealthyInstances(serviceId);
return instancesResponse.getServiceInstances();
return instancesResponse.toServiceInstances();
}
}

@ -69,7 +69,7 @@ public class PolarisServiceDiscoveryTest {
DefaultServiceInstances mockDefaultServiceInstances = mock(DefaultServiceInstances.class);
when(mockDefaultServiceInstances.getInstances()).thenReturn(singletonList(mock(DefaultInstance.class)));
InstancesResponse mockInstancesResponse = mock(InstancesResponse.class);
when(mockInstancesResponse.getServiceInstances()).thenReturn(mockDefaultServiceInstances);
when(mockInstancesResponse.toServiceInstances()).thenReturn(mockDefaultServiceInstances);
when(polarisDiscoveryHandler.getHealthyInstances(anyString())).thenReturn(mockInstancesResponse);
List<ServiceInstance> serviceInstances = polarisServiceDiscovery.getInstances(SERVICE_PROVIDER);

@ -106,7 +106,17 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>

@ -74,7 +74,7 @@
<!-- Dependencies -->
<polaris.version>1.11.0-SNAPSHOT</polaris.version>
<grpc.version>1.50.0</grpc.version>
<junit.version>4.13.2</junit.version>
<guava.version>31.0.1-jre</guava.version>
<logback.version>1.2.11</logback.version>
<mocktio.version>4.5.1</mocktio.version>
@ -232,18 +232,6 @@
<version>${byte-buddy.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-all</artifactId>
<version>${grpc.version}</version>
<exclusions>
<exclusion>
<artifactId>grpc-xds</artifactId>
<groupId>io.grpc</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
@ -264,6 +252,14 @@
<version>${system-stubs-junit4.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

Loading…
Cancel
Save