@Test
public void publishesContextResolverWithFactoryAndOverridesPerRequestContextResolverThroughEverrestApplication() {

    EverrestApplication application = mock(EverrestApplication.class);
    ObjectFactory contextResolverFactory = mockObjectFactory(ContextResolverText.class);
    when(application.getClasses()).thenReturn(newHashSet(ContextResolverText.class));
    when(application.getFactories()).thenReturn(newHashSet(contextResolverFactory));
    publisher.publish(application);
    verify(providers, never()).addContextResolver(ContextResolverText.class);
    verify(providers).addContextResolver(contextResolverFactory);
}