use of org.sonarlint.daemon.interceptors.ExceptionInterceptor.TransformStatusServerCall in project sonarlint-core by SonarSource.
the class ExceptionInterceptorTest method transformStatus.
private Status transformStatus(Exception cause) {
ArgumentCaptor<Status> argument = ArgumentCaptor.forClass(Status.class);
ServerCall<Void, Void> delegate = mock(ServerCall.class);
Status status = Status.UNKNOWN.withCause(cause);
assertThat(status.getDescription()).isNull();
Metadata trailers = new Metadata();
TransformStatusServerCall<Void, Void> serverCall = new TransformStatusServerCall<>(delegate);
serverCall.close(status, trailers);
verify(delegate).close(argument.capture(), any(Metadata.class));
return argument.getValue();
}
Aggregations