@Test public void shouldAddConfigToRoles() { Stack stack = new Stack(); ApiRoleList apiRoleList = new ApiRoleList(); ApiRole apiRole = new ApiRole(); apiRoleList.addItemsItem(apiRole); underTest.setConfigs(stack, apiRoleList); assertThat(apiRole.getConfig().getItems()) .anySatisfy(apiConfig -> assertThat(apiConfig) .returns(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, ApiConfig::getName) .returns(CmMgmtServiceLogConfigService.VALUE, ApiConfig::getValue)); }
@Override public void setConfigs(Stack stack, ApiRoleList apiRoleList) { if (Objects.nonNull(apiRoleList) && !CollectionUtils.isEmpty(apiRoleList.getItems())) { apiRoleList.getItems().forEach(apiRole -> addConfig(apiRole, createApiConfig(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, CmMgmtServiceLogConfigService.VALUE))); } }
CmMgmtServiceLogConfigService implements CmConfigServiceDelegate { @Override public void setConfigs(Stack stack, ApiRoleList apiRoleList) { if (Objects.nonNull(apiRoleList) && !CollectionUtils.isEmpty(apiRoleList.getItems())) { apiRoleList.getItems().forEach(apiRole -> addConfig(apiRole, createApiConfig(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, CmMgmtServiceLogConfigService.VALUE))); } } }
CmMgmtServiceLogConfigService implements CmConfigServiceDelegate { @Override public void setConfigs(Stack stack, ApiRoleList apiRoleList) { if (Objects.nonNull(apiRoleList) && !CollectionUtils.isEmpty(apiRoleList.getItems())) { apiRoleList.getItems().forEach(apiRole -> addConfig(apiRole, createApiConfig(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, CmMgmtServiceLogConfigService.VALUE))); } }  }
CmMgmtServiceLogConfigService implements CmConfigServiceDelegate { @Override public void setConfigs(Stack stack, ApiRoleList apiRoleList) { if (Objects.nonNull(apiRoleList) && !CollectionUtils.isEmpty(apiRoleList.getItems())) { apiRoleList.getItems().forEach(apiRole -> addConfig(apiRole, createApiConfig(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, CmMgmtServiceLogConfigService.VALUE))); } }  @Override void setConfigs(Stack stack, ApiRoleList apiRoleList); }
CmMgmtServiceLogConfigService implements CmConfigServiceDelegate { @Override public void setConfigs(Stack stack, ApiRoleList apiRoleList) { if (Objects.nonNull(apiRoleList) && !CollectionUtils.isEmpty(apiRoleList.getItems())) { apiRoleList.getItems().forEach(apiRole -> addConfig(apiRole, createApiConfig(CmMgmtServiceLogConfigService.MAX_LOG_BACKUP_INDEX, CmMgmtServiceLogConfigService.VALUE))); } }  @Override void setConfigs(Stack stack, ApiRoleList apiRoleList);  }