Hi,
I'm trying to upgrade to 1.6.1 but I ran into this problem. Currently have
the following code:
requestHeaders = new Metadata();
attributes = Attributes.newBuilder()
.set(Grpc.TRANSPORT_ATTR_SSL_SESSION, sslSession)
.build();
when(call.getAttributes()).thenReturn(attributes);
when(call.getMethodDescriptor()).thenReturn(methodDescriptor);
when(sslSession.getPeerPrincipal()).thenReturn(peerPrincipal);
validator = new CertAuthInterceptor(true, AUTH_MAP);
...
when(peerPrincipal.getName()).thenReturn("my peer principal");
when(methodDescriptor.getFullMethodName()).thenReturn("my method..."
);
validator.interceptCall(call, requestHeaders, next);
This doesn't work any more because MethodDescriptor has been marked final
and ServerCall has @DoNotMock annotation. How do I do this now? The
annotation suggests using InProcessTransport, but it seems that Attributes
are hard-coded in it, so I cannot provide sslSession. I also don't
understand why I now have to jump through hoops to do such a simple test.
(CertAuthInterceptor is a ServerInterceptor that allows/denies a method
call depending on the client certificate and AUTH_MAP).
thanks,
Eugene
--
You received this message because you are subscribed to the Google Groups
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit
https://groups.google.com/d/msgid/grpc-io/2dff10f7-2b95-45f7-bbe4-ff0cfb2ddd96%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.