ResourceMethod rmethod = mock(ResourceMethod.class);
when(rmethod.getMethod()).thenReturn(method);
Class clazz = FakeResource.class;
when(rmethod.getResourceClass()).thenReturn(clazz);
Consumer c = createConsumer(createOwner());
methodInjector.setArguments(new Object[] {c.getUuid()});
when(consumerCurator.getConsumer(eq(c.getUuid()))).thenReturn(c);
when(consumerCurator.findByUuid(eq(c.getUuid()))).thenReturn(c);
// create mock certs to trigger SSLAuth provider
X509Certificate[] certs = new X509Certificate[1];
X509Certificate cert = mock(X509Certificate.class);
certs[0] = cert;
req.setAttribute("javax.servlet.request.X509Certificate", certs);
java.security.Principal p = mock(java.security.Principal.class);
when(p.getName()).thenReturn("CN=" + c.getUuid() + ", C=US, L=Raleigh");
when(cert.getSubjectDN()).thenReturn(p);
interceptor.preProcess(req, rmethod);
Principal p1 = ResteasyProviderFactory.getContextData(Principal.class);