@Test public void testConfigurationExists() throws Exception { DescriptorKey descriptorKey = createDescriptorKey(); ConfigurationAccessor configurationAccessor = Mockito.mock(ConfigurationAccessor.class); DefaultDescriptorGlobalConfigUtility configUtility = new DefaultDescriptorGlobalConfigUtility(descriptorKey, configurationAccessor, null, null); assertFalse(configUtility.doesConfigurationExist()); ConfigurationModel configurationModel = Mockito.mock(ConfigurationModel.class); Mockito.when(configurationAccessor.getConfigurationsByDescriptorKeyAndContext(Mockito.any(DescriptorKey.class), Mockito.any(ConfigContextEnum.class))).thenReturn(List.of(configurationModel)); assertTrue(configUtility.doesConfigurationExist()); }
public boolean doesConfigurationExist() { try { return !configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context).isEmpty(); } catch (AlertException ex) { logger.debug("Error reading configuration from database.", ex); return false; } }
DefaultDescriptorGlobalConfigUtility { public boolean doesConfigurationExist() { try { return !configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context).isEmpty(); } catch (AlertException ex) { logger.debug("Error reading configuration from database.", ex); return false; } } }
DefaultDescriptorGlobalConfigUtility { public boolean doesConfigurationExist() { try { return !configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context).isEmpty(); } catch (AlertException ex) { logger.debug("Error reading configuration from database.", ex); return false; } } DefaultDescriptorGlobalConfigUtility(DescriptorKey descriptorKey, ConfigurationAccessor configurationAccessor, ApiAction apiAction,
        ConfigurationFieldModelConverter configurationFieldModelConverter); }
DefaultDescriptorGlobalConfigUtility { public boolean doesConfigurationExist() { try { return !configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context).isEmpty(); } catch (AlertException ex) { logger.debug("Error reading configuration from database.", ex); return false; } } 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 boolean doesConfigurationExist() { try { return !configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context).isEmpty(); } catch (AlertException ex) { logger.debug("Error reading configuration from database.", ex); return false; } } 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);  }