### Question:
DefaultConfigurationAccessor implements ConfigurationAccessor { @Override public List<ConfigurationModel> getConfigurationsByDescriptorNameAndContext(String descriptorName, ConfigContextEnum context) throws AlertDatabaseConstraintException { if (StringUtils.isBlank(descriptorName)) { throw new AlertDatabaseConstraintException("Descriptor name cannot be null"); } if (null == context) { throw new AlertDatabaseConstraintException("Context cannot be null"); } Long contextId = getConfigContextIdOrThrowException(context); Long descriptorId = getDescriptorIdOrThrowException(descriptorName); List<DescriptorConfigEntity> descriptorConfigEntities = descriptorConfigsRepository.findByDescriptorIdAndContextId(descriptorId, contextId); List<ConfigurationModel> configurationModels = new ArrayList<>(); for (DescriptorConfigEntity descriptorConfigEntity : descriptorConfigEntities) { configurationModels.add(createConfigModel(descriptorConfigEntity.getDescriptorId(), descriptorConfigEntity.getId(), descriptorConfigEntity.getCreatedAt(), descriptorConfigEntity.getLastUpdated(), contextId)); } return configurationModels; } @Autowired  DefaultConfigurationAccessor(RegisteredDescriptorRepository registeredDescriptorRepository, DescriptorTypeRepository descriptorTypeRepository, DefinedFieldRepository definedFieldRepository,
        DescriptorConfigRepository descriptorConfigsRepository, ConfigGroupRepository configGroupRepository, ConfigContextRepository configContextRepository, FieldValueRepository fieldValueRepository,
        EncryptionUtility encryptionUtility); @Override List<ConfigurationJobModel> getAllJobs(); @Override Optional<ConfigurationJobModel> getJobById(UUID jobId); @Override List<ConfigurationJobModel> getJobsByFrequency(FrequencyType frequency); @Override ConfigurationJobModel createJob(Collection<String> descriptorNames, Collection<ConfigurationFieldModel> configuredFields); @Override ConfigurationJobModel updateJob(UUID jobId, Collection<String> descriptorNames, Collection<ConfigurationFieldModel> configuredFields); @Override void deleteJob(UUID jobId); @Override Optional<ConfigurationModel> getProviderConfigurationByName(String providerConfigName); @Override Optional<ConfigurationModel> getConfigurationById(Long id); @Override List<ConfigurationModel> getConfigurationsByDescriptorKey(DescriptorKey descriptorKey); @Override List<ConfigurationModel> getConfigurationsByDescriptorType(DescriptorType descriptorType); @Override List<ConfigurationModel> getChannelConfigurationsByFrequency(FrequencyType frequencyType); @Override List<ConfigurationModel> getConfigurationsByDescriptorKeyAndContext(DescriptorKey descriptorKey, ConfigContextEnum context); @Override ConfigurationModel createConfiguration(DescriptorKey descriptorKey, ConfigContextEnum context, Collection<ConfigurationFieldModel> configuredFields); @Override List<ConfigurationModel> getConfigurationsByDescriptorNameAndContext(String descriptorName, ConfigContextEnum context); @Override ConfigurationModel updateConfiguration(Long descriptorConfigId, Collection<ConfigurationFieldModel> configuredFields); @Override void deleteConfiguration(ConfigurationModel configModel); @Override void deleteConfiguration(Long descriptorConfigId); static final String EXCEPTION_FORMAT_DESCRIPTOR_KEY_IS_NOT_VALID; }### Answer:
@Test public void getConfigurationByDescriptorNameAndContextNullTest() throws Exception { DefaultConfigurationAccessor configurationAccessor = new DefaultConfigurationAccessor(null, null, null, null, null, null, null, null); try { configurationAccessor.getConfigurationsByDescriptorNameAndContext(null, configContextEnum); fail("Null descriptorName did not throw expected AlertDatabaseConstraintException."); } catch (AlertDatabaseConstraintException e) { assertNotNull(e); } try { configurationAccessor.getConfigurationsByDescriptorNameAndContext("descriptorName", null); fail("Null context did not throw expected AlertDatabaseConstraintException."); } catch (AlertDatabaseConstraintException e) { assertNotNull(e); } }