@Test(expected = NotAuthorizedException.class)
public void clientWhenPrincipalAbsentThrows() {

  when(httpServletRequest.getLocalPort()).thenReturn(xfccDisallowedPort);
  when(securityContext.getUserPrincipal()).thenReturn(null);
  factory.provide(request, httpServletRequest);
}