use of eu.bcvsolutions.idm.core.api.dto.IdmConfigurationDto in project CzechIdMng by bcvsolutions.
the class PreserveUuidIntegrationTest method testIsNotNew.
@Test
public void testIsNotNew() {
IdmConfigurationDto configuration = new IdmConfigurationDto();
configuration.setName("test-property-two");
configuration.setValue("one");
//
assertTrue(configurationService.isNew(configuration));
//
configuration = configurationService.save(configuration);
//
assertFalse(configurationService.isNew(configuration));
//
IdmConfigurationDto clone = new IdmConfigurationDto(configuration.getId());
//
assertFalse(configurationService.isNew(clone));
}
use of eu.bcvsolutions.idm.core.api.dto.IdmConfigurationDto in project CzechIdMng by bcvsolutions.
the class PreserveUuidIntegrationTest method testIsNewWithId.
@Test
public void testIsNewWithId() {
UUID id = UUID.randomUUID();
IdmConfigurationDto configuration = new IdmConfigurationDto(id);
configuration.setName("test-property-one");
configuration.setValue("one");
//
assertTrue(configurationService.isNew(configuration));
}
use of eu.bcvsolutions.idm.core.api.dto.IdmConfigurationDto in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationServiceIntegrationTest method testReadConfidentialPropertyFromDB.
@Test
@Transactional
public void testReadConfidentialPropertyFromDB() {
configurationService.saveConfiguration(new IdmConfigurationDto(TEST_GUARDED_PROPERTY_KEY, "secured_change"));
assertEquals("secured_change", configurationService.getValue(TEST_GUARDED_PROPERTY_KEY));
}
use of eu.bcvsolutions.idm.core.api.dto.IdmConfigurationDto in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationService method toConfigurationDto.
private static IdmConfigurationDto toConfigurationDto(String key, Object value) {
String stringValue = value == null ? null : value.toString();
IdmConfigurationDto configuration = new IdmConfigurationDto(key, stringValue);
// password etc. has to be guarded - can be used just in BE
if (shouldBeConfidential(configuration.getName())) {
LOG.debug("Configuration value for property [{}] is guarded.", configuration.getName());
configuration.setValue(GuardedString.SECRED_PROXY_STRING);
configuration.setConfidential(true);
}
if (shouldBeSecured(configuration.getName())) {
configuration.setSecured(true);
}
return configuration;
}
use of eu.bcvsolutions.idm.core.api.dto.IdmConfigurationDto in project CzechIdMng by bcvsolutions.
the class DefaultConfigurationService method setValue.
@Override
@Transactional
public void setValue(String key, String value) {
Assert.hasText(key);
//
saveConfiguration(new IdmConfigurationDto(key, value));
}
Aggregations