RSConfig extends Application { void addRestResourceClasses(Set<Class<?>> resources) { logger.info("Register ocelot resources..."); for (Object restEndpoint : restEndpoints) { Class cls = unProxyClassServices.getRealClass(restEndpoint.getClass()); logger.info("Register ocelot resource {}", cls.getName()); resources.add(cls); } }  @Override Set<Class<?>> getClasses();  }
@Test public void testAddRestResourceClasses() { System.out.println("addRestResourceClasses"); ((FakeCDI) restEndpoints).add(new RSEndpoint()); when(unProxyClassServices.getRealClass(eq(RSEndpoint.class))).thenReturn((Class) RSEndpoint.class); Set<Class<?>> set = new HashSet<>(); instance.addRestResourceClasses(set); assertThat(set).isNotEmpty(); assertThat(set).hasSize(1); assertThat(set).contains(RSEndpoint.class); }