use of io.grpc.reflection.v1alpha.ServiceResponse in project grpc-java by grpc.
the class ProtoReflectionServiceTest method assertServiceResponseEquals.
private void assertServiceResponseEquals(Set<ServiceResponse> goldenResponse) throws Exception {
ServerReflectionRequest request = ServerReflectionRequest.newBuilder().setHost(TEST_HOST).setListServices("services").build();
StreamRecorder<ServerReflectionResponse> responseObserver = StreamRecorder.create();
StreamObserver<ServerReflectionRequest> requestObserver = stub.serverReflectionInfo(responseObserver);
requestObserver.onNext(request);
requestObserver.onCompleted();
List<ServiceResponse> response = responseObserver.firstValue().get().getListServicesResponse().getServiceList();
assertEquals(goldenResponse.size(), response.size());
assertEquals(goldenResponse, new HashSet<ServiceResponse>(response));
}
Aggregations