JerseyRestApplication extends ResourceConfig { public static void clear() { resourcesMap.clear(); packages.clear(); } JerseyRestApplication();  JerseyRestApplication(List<Object> allResources,List<String> packages, List<Class<?>> resources, Map<String, Object> serverProperties); static void clear();  }
@Test public void testDefaultConstructorCleared() { JerseyRestApplication.getResourcesMap().clear(); ServerThreadLocalVariables.getContext().set(Thread.currentThread().getName()); JerseyRestApplication app = new JerseyRestApplication(); assertThat(app.getApplication().getClasses().stream().map(c -> c.getName()).collect(Collectors.toSet()),hasItem("com.oath.micro.server.rest.jackson.JacksonFeature")); assertFalse(app.isRegistered(ServletStatusResource.class)); }
@Test @Ignore public void testConstructor() { JerseyRestApplication.getResourcesMap().clear(); JerseyRestApplication app = new JerseyRestApplication(Arrays.asList(new ServletStatusResource()), Arrays.asList(),Arrays.asList(JacksonFeature.class), new HashMap<>()); assertThat(app.getApplication().getClasses().size(),is(1)); assertTrue(app.isRegistered(ServletStatusResource.class)); }