use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testUpperCase.
@Test
public void testUpperCase() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName("NODE-" + System.currentTimeMillis());
node.setTreeType(type.getId());
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNotNull(generated.getCode());
assertEquals(node.getName().toLowerCase(), generated.getCode());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testGreenLine.
@Test
public void testGreenLine() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setName("node-" + System.currentTimeMillis());
node.setTreeType(type.getId());
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNotNull(generated.getCode());
assertEquals(node.getName(), generated.getCode());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class IdentityRoleFormDefaultValueGeneratorTest method createGenerator.
/**
* Method create generator for this test and remove all another generators.
*
* @return
*/
private IdmGenerateValueDto createGenerator() {
IdmGenerateValueDto generateValue = new IdmGenerateValueDto();
generateValue.setDtoType(getDtoType().getCanonicalName());
generateValue.setGeneratorType(getGeneratorType());
generateValue.setSeq((short) 100);
generateValue.setUnmodifiable(true);
return generateValueService.save(generateValue);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class AbstractGeneratorTest method createGenerator.
/**
* Create generated attribute
*
* @param entityType
* @param generatorType
* @param generatorProperties
* @param seq
* @param regenerateValue
* @return
*/
protected IdmGenerateValueDto createGenerator(Class<? extends AbstractDto> dtoType, String generatorType, ConfigurationMap generatorProperties, Integer seq, Boolean regenerateValue) {
IdmGenerateValueDto dto = new IdmGenerateValueDto();
dto.setDtoType(dtoType.getCanonicalName());
dto.setGeneratorType(generatorType);
dto.setGeneratorProperties(generatorProperties);
dto.setSeq(seq == null ? 0 : seq.shortValue());
dto.setRegenerateValue(regenerateValue == null ? true : regenerateValue.booleanValue());
return generatedAttributeService.save(dto);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class IdmGenerateValueRestTest method prepareDto.
@Override
protected IdmGenerateValueDto prepareDto() {
IdmGenerateValueDto dto = new IdmGenerateValueDto();
dto.setDtoType(IdmIdentityDto.class.getCanonicalName());
dto.setGeneratorType(IdentityFormDefaultValueGenerator.class.getCanonicalName());
dto.setSeq((short) 100);
return dto;
}
Aggregations