### Question:
DefaultDescriptorGlobalConfigUtility { public Optional<ConfigurationModel> getConfiguration() throws AlertException { return configurationAccessor.getConfigurationsByDescriptorKeyAndContext(key, context) .stream() .findFirst(); } 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);  }### Answer:
@Test public void testGetConfiguration() throws Exception { DescriptorKey descriptorKey = createDescriptorKey(); ConfigurationAccessor configurationAccessor = Mockito.mock(ConfigurationAccessor.class); DefaultDescriptorGlobalConfigUtility configUtility = new DefaultDescriptorGlobalConfigUtility(descriptorKey, configurationAccessor, null, null); assertFalse(configUtility.getConfiguration().isPresent()); ConfigurationModel configurationModel = Mockito.mock(ConfigurationModel.class); Mockito.when(configurationAccessor.getConfigurationsByDescriptorKeyAndContext(Mockito.any(DescriptorKey.class), Mockito.any(ConfigContextEnum.class))).thenReturn(List.of(configurationModel)); assertTrue(configUtility.getConfiguration().isPresent()); }