@Test void testRegister() { Map<String, DynamicRepositoryDecoratorFactory> map = new HashMap<>(); map.put("decoratorFactory1", decoratorFactory1); map.put("decoratorFactory2", decoratorFactory2); when(context.getBeansOfType(DynamicRepositoryDecoratorFactory.class)).thenReturn(map); DynamicRepositoryDecoratorFactoryRegistrar dynamicRepositoryDecoratorFactoryRegistrar = new DynamicRepositoryDecoratorFactoryRegistrar(repositoryDecoratorRegistry); dynamicRepositoryDecoratorFactoryRegistrar.register(context); verify(repositoryDecoratorRegistry).addFactory(decoratorFactory1); verify(repositoryDecoratorRegistry).addFactory(decoratorFactory2); }
public void register(ApplicationContext context) { Map<String, DynamicRepositoryDecoratorFactory> repositoryDecoratorFactoryMap = context.getBeansOfType(DynamicRepositoryDecoratorFactory.class); repositoryDecoratorFactoryMap.values().forEach(repositoryDecoratorRegistry::addFactory); }
DynamicRepositoryDecoratorFactoryRegistrar { public void register(ApplicationContext context) { Map<String, DynamicRepositoryDecoratorFactory> repositoryDecoratorFactoryMap = context.getBeansOfType(DynamicRepositoryDecoratorFactory.class); repositoryDecoratorFactoryMap.values().forEach(repositoryDecoratorRegistry::addFactory); } }
DynamicRepositoryDecoratorFactoryRegistrar { public void register(ApplicationContext context) { Map<String, DynamicRepositoryDecoratorFactory> repositoryDecoratorFactoryMap = context.getBeansOfType(DynamicRepositoryDecoratorFactory.class); repositoryDecoratorFactoryMap.values().forEach(repositoryDecoratorRegistry::addFactory); } DynamicRepositoryDecoratorFactoryRegistrar(
      DynamicRepositoryDecoratorRegistry repositoryDecoratorRegistry); }
DynamicRepositoryDecoratorFactoryRegistrar { public void register(ApplicationContext context) { Map<String, DynamicRepositoryDecoratorFactory> repositoryDecoratorFactoryMap = context.getBeansOfType(DynamicRepositoryDecoratorFactory.class); repositoryDecoratorFactoryMap.values().forEach(repositoryDecoratorRegistry::addFactory); } DynamicRepositoryDecoratorFactoryRegistrar(
      DynamicRepositoryDecoratorRegistry repositoryDecoratorRegistry); void register(ApplicationContext context); }
DynamicRepositoryDecoratorFactoryRegistrar { public void register(ApplicationContext context) { Map<String, DynamicRepositoryDecoratorFactory> repositoryDecoratorFactoryMap = context.getBeansOfType(DynamicRepositoryDecoratorFactory.class); repositoryDecoratorFactoryMap.values().forEach(repositoryDecoratorRegistry::addFactory); } DynamicRepositoryDecoratorFactoryRegistrar(
      DynamicRepositoryDecoratorRegistry repositoryDecoratorRegistry); void register(ApplicationContext context);  }