@Test
public void ignoresScanParameterIfApplicationIsConfiguredInServletContext() throws Exception {

    when(servletContext.getInitParameter("javax.ws.rs.Application")).thenReturn(SomeApplication.class.getName());
    when(servletContext.getInitParameter("org.everrest.scan.components")).thenReturn("true");
    EverrestServletContextInitializer everrestServletContextInitializer = new EverrestServletContextInitializer(servletContext);
    Application application = everrestServletContextInitializer.getApplication();
    assertEquals(SomeApplication.class, application.getClass());
    assertTrue("Must ignore scan 'org.everrest.scan.components' parameter if FQN of Application class configured in ServletContext",
               application.getClasses() == null || application.getClasses().isEmpty());
}