use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testAllCombinationWithClassicSave.
@Test
public void testAllCombinationWithClassicSave() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName("AB CDa bc dř Ř ř");
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = treeNodeService.save(node);
assertNotNull(generated.getCode());
assertEquals("abcdabcdrrr", generated.getCode());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testWhiteSpace.
@Test
public void testWhiteSpace() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName(" no de- test123");
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNotNull(generated.getCode());
assertEquals("node-test123", generated.getCode());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testNullName.
@Test
public void testNullName() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName(null);
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNull(generated.getCode());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testEmptyName.
@Test
public void testEmptyName() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName("");
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNotNull(generated.getCode());
assertTrue(generated.getCode().isEmpty());
generatedAttributeService.delete(generator);
}
use of eu.bcvsolutions.idm.core.api.dto.IdmGenerateValueDto in project CzechIdMng by bcvsolutions.
the class TreeNodeCodeGeneratorTest method testAllCombination.
@Test
public void testAllCombination() {
IdmTreeTypeDto type = getHelper().createTreeType();
IdmTreeNodeDto node = new IdmTreeNodeDto();
node.setTreeType(type.getId());
node.setName("ABCDa bc dř Ř ř");
IdmGenerateValueDto generator = this.createGenerator(getDtoType(), getGeneratorType(), null, 1, null);
IdmTreeNodeDto generated = valueGeneratorManager.generate(node);
assertNotNull(generated.getCode());
assertEquals("abcdabcdrrr", generated.getCode());
generatedAttributeService.delete(generator);
}
Aggregations