CacheableEventPublishingNacosServiceFactory implements NacosServiceFactory { @Override public Collection<ConfigService> getConfigServices() { return configServicesCache.values(); } CacheableEventPublishingNacosServiceFactory(); static CacheableEventPublishingNacosServiceFactory getSingleton(); @Override ConfigService createConfigService(Properties properties); @Override NamingService createNamingService(Properties properties); @Override NamingMaintainService createNamingMaintainService(Properties properties); T deferCreateService(T service, Properties properties); @SuppressWarnings("unchecked") void publishDeferService(ApplicationContext context); void setApplicationContext(ApplicationContext applicationContext); @Override Collection<ConfigService> getConfigServices(); @Override Collection<NamingService> getNamingServices(); @Override Collection<NamingMaintainService> getNamingMaintainService();  }
@Test public void testGetConfigServices() throws NacosException { ConfigService configService = nacosServiceFactory.createConfigService(properties); ConfigService configService2 = nacosServiceFactory .createConfigService(properties); Assert.assertTrue(configService == configService2); Assert.assertEquals(1, nacosServiceFactory.getConfigServices().size()); Assert.assertEquals(configService, nacosServiceFactory.getConfigServices().iterator().next()); }