@Test public void testGetFieldModelEmptyConfiguration() throws Exception { DescriptorKey descriptorKey = createDescriptorKey(); ConfigurationAccessor configurationAccessor = Mockito.mock(ConfigurationAccessor.class); ConfigurationFieldModelConverter converter = Mockito.mock(ConfigurationFieldModelConverter.class); DefaultDescriptorGlobalConfigUtility configUtility = new DefaultDescriptorGlobalConfigUtility(descriptorKey, configurationAccessor, null, converter); assertFalse(configUtility.getFieldModel().isPresent()); }
public Optional<FieldModel> getFieldModel() throws AlertException { Optional<ConfigurationModel> configurationModelOptional = getConfiguration(); if (configurationModelOptional.isPresent()) { ConfigurationModel configurationModel = configurationModelOptional.get(); FieldModel fieldModel = configurationFieldModelConverter.convertToFieldModel(configurationModel); return Optional.ofNullable(apiAction.afterGetAction(fieldModel)); } return Optional.empty(); }
DefaultDescriptorGlobalConfigUtility { public Optional<FieldModel> getFieldModel() throws AlertException { Optional<ConfigurationModel> configurationModelOptional = getConfiguration(); if (configurationModelOptional.isPresent()) { ConfigurationModel configurationModel = configurationModelOptional.get(); FieldModel fieldModel = configurationFieldModelConverter.convertToFieldModel(configurationModel); return Optional.ofNullable(apiAction.afterGetAction(fieldModel)); } return Optional.empty(); } }
DefaultDescriptorGlobalConfigUtility { public Optional<FieldModel> getFieldModel() throws AlertException { Optional<ConfigurationModel> configurationModelOptional = getConfiguration(); if (configurationModelOptional.isPresent()) { ConfigurationModel configurationModel = configurationModelOptional.get(); FieldModel fieldModel = configurationFieldModelConverter.convertToFieldModel(configurationModel); return Optional.ofNullable(apiAction.afterGetAction(fieldModel)); } return Optional.empty(); } DefaultDescriptorGlobalConfigUtility(DescriptorKey descriptorKey, ConfigurationAccessor configurationAccessor, ApiAction apiAction,
        ConfigurationFieldModelConverter configurationFieldModelConverter); }
DefaultDescriptorGlobalConfigUtility { public Optional<FieldModel> getFieldModel() throws AlertException { Optional<ConfigurationModel> configurationModelOptional = getConfiguration(); if (configurationModelOptional.isPresent()) { ConfigurationModel configurationModel = configurationModelOptional.get(); FieldModel fieldModel = configurationFieldModelConverter.convertToFieldModel(configurationModel); return Optional.ofNullable(apiAction.afterGetAction(fieldModel)); } return Optional.empty(); } DefaultDescriptorGlobalConfigUtility(DescriptorKey descriptorKey, ConfigurationAccessor configurationAccessor, ApiAction apiAction,
        ConfigurationFieldModelConverter configurationFieldModelConverter); DescriptorKey getKey(); boolean doesConfigurationExist(); Optional<ConfigurationModel> getConfiguration(); Optional<FieldModel> getFieldModel(); FieldModel save(FieldModel fieldModel); FieldModel update(Long id, FieldModel fieldModel); }
DefaultDescriptorGlobalConfigUtility { public Optional<FieldModel> getFieldModel() throws AlertException { Optional<ConfigurationModel> configurationModelOptional = getConfiguration(); if (configurationModelOptional.isPresent()) { ConfigurationModel configurationModel = configurationModelOptional.get(); FieldModel fieldModel = configurationFieldModelConverter.convertToFieldModel(configurationModel); return Optional.ofNullable(apiAction.afterGetAction(fieldModel)); } return Optional.empty(); } DefaultDescriptorGlobalConfigUtility(DescriptorKey descriptorKey, ConfigurationAccessor configurationAccessor, ApiAction apiAction,
        ConfigurationFieldModelConverter configurationFieldModelConverter); DescriptorKey getKey(); boolean doesConfigurationExist(); Optional<ConfigurationModel> getConfiguration(); Optional<FieldModel> getFieldModel(); FieldModel save(FieldModel fieldModel); FieldModel update(Long id, FieldModel fieldModel);  }