@Test public void shouldDelegateToEachService() { Stack stack = new Stack(); ApiRoleList apiRoleList = new ApiRoleList(); underTest.setConfigs(stack, apiRoleList); verify(service1).setConfigs(stack, apiRoleList); verify(service2).setConfigs(stack, apiRoleList); }
public void setConfigs(Stack stack, ApiRoleList apiRoleList) { delegates.forEach(configService -> configService.setConfigs(stack, apiRoleList)); }
CmConfigService { public void setConfigs(Stack stack, ApiRoleList apiRoleList) { delegates.forEach(configService -> configService.setConfigs(stack, apiRoleList)); } }
CmConfigService { public void setConfigs(Stack stack, ApiRoleList apiRoleList) { delegates.forEach(configService -> configService.setConfigs(stack, apiRoleList)); } CmConfigService(List<CmConfigServiceDelegate> delegates); }
CmConfigService { public void setConfigs(Stack stack, ApiRoleList apiRoleList) { delegates.forEach(configService -> configService.setConfigs(stack, apiRoleList)); } CmConfigService(List<CmConfigServiceDelegate> delegates); void setConfigs(Stack stack, ApiRoleList apiRoleList); }
CmConfigService { public void setConfigs(Stack stack, ApiRoleList apiRoleList) { delegates.forEach(configService -> configService.setConfigs(stack, apiRoleList)); } CmConfigService(List<CmConfigServiceDelegate> delegates); void setConfigs(Stack stack, ApiRoleList apiRoleList);  }