@Test
public void testResolveOriginProvidedFetchesExistingOriginByName() throws Exception {

  OriginEntity origin = new OriginEntity();
  when(originManager.getOrigin("origin")).thenReturn(origin);
  assertSame(origin, handler.resolveOrigin("origin"));
  verify(originManager).getOrigin("origin");
  verify(securityContext).checkReadPermission(origin);
  verifyNoMoreInteractions(originManager);
}