test_class.declarator: identityService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private IdmIdentityService identityService;
test_class.type: IdmIdentityService
test_class.var_name: identityService
test_class.file: Realization/backend/core/core-impl/src/test/java/eu/bcvsolutions/idm/core/generator/identity/IdentityUsernameGeneratorTest.java
test_class.identifier: IdentityUsernameGeneratorTest
test_class.superclass: extends AbstractGeneratorTest
test_case.body: @Test
  	public void generateDiacriticAndUpper() {
  		String firstName = "áčďéěžšǍÁ";
  		String lastName = "óÉČŘčř-";
  		
  		String newFirstName = "acdeezsaa";
  		String newLastName = "oecrcr-";
  
  		ValueGeneratorDto generator = getGenerator();
  
  		this.createGenerator(getDtoType(), getGeneratorType(),
  				this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
  						IdentityUsernameGenerator.FIRST_NAME_FIRST, Boolean.TRUE.toString())), 1, null);
  
  		IdmIdentityDto identityDto = new IdmIdentityDto();
  		identityDto.setFirstName(firstName);
  		identityDto.setLastName(lastName);
  		IdmIdentityDto generatedDto = valueGeneratorManager.generate(identityDto);
  		
  		assertEquals(identityDto.getLastName(), generatedDto.getLastName());
  		assertEquals(identityDto.getFirstName(), generatedDto.getFirstName());
  		
  		assertNotNull(generatedDto.getUsername());
  		assertEquals(newFirstName + newLastName, generatedDto.getUsername());
  	}
test_case.class_method_signature: IdentityUsernameGeneratorTest.generateDiacriticAndUpper()
test_case.full_signature: @Test public void generateDiacriticAndUpper()
test_case.identifier: generateDiacriticAndUpper
test_case.invocations: getGenerator createGenerator getDtoType getGeneratorType createConfiguration getFormDefinition of toString setFirstName setLastName generate assertEquals getLastName getLastName assertEquals getFirstName getFirstName assertNotNull getUsername assertEquals getUsername
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void generateDiacriticAndUpper()
focal_class.declarator: GENERATOR_NAME = "core-identity-username-value-generator"
focal_class.modifier: public static final
focal_class.original_string: public static final String GENERATOR_NAME = "core-identity-username-value-generator";
focal_class.type: String
focal_class.var_name: GENERATOR_NAME
focal_class.declarator: SEARCH_UNIQUE_USERNAME = "searchUniqueUsername"
focal_class.modifier: public static
focal_class.original_string: public static String SEARCH_UNIQUE_USERNAME = "searchUniqueUsername";
focal_class.type: String
focal_class.var_name: SEARCH_UNIQUE_USERNAME
focal_class.declarator: MAXIMUM_SEARCH_FOR_UNIQUE_USERNAME = 100
focal_class.modifier: private static
focal_class.original_string: private static int MAXIMUM_SEARCH_FOR_UNIQUE_USERNAME = 100;
focal_class.type: int
focal_class.var_name: MAXIMUM_SEARCH_FOR_UNIQUE_USERNAME
focal_class.declarator: identityService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private IdmIdentityService identityService;
focal_class.type: IdmIdentityService
focal_class.var_name: identityService
focal_class.file: Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/generator/identity/IdentityUsernameGenerator.java
focal_class.identifier: IdentityUsernameGenerator
focal_class.class_method_signature: IdentityUsernameGenerator.getName()
focal_class.full_signature: @Override public String getName()
focal_class.identifier: getName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getName()
focal_class.class_method_signature: IdentityUsernameGenerator.getPropertyNames()
focal_class.full_signature: @Override public List<String> getPropertyNames()
focal_class.identifier: getPropertyNames
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> getPropertyNames()
focal_class.class_method_signature: IdentityUsernameGenerator.generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_class.full_signature: @Override public IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_class.identifier: generate
focal_class.modifiers: @Override public
focal_class.parameters: (IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_class.return: IdmIdentityDto
focal_class.signature: IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_class.class_method_signature: IdentityUsernameGenerator.getUniqueUsername(String username)
focal_class.full_signature: private String getUniqueUsername(String username)
focal_class.identifier: getUniqueUsername
focal_class.modifiers: private
focal_class.parameters: (String username)
focal_class.return: String
focal_class.signature: String getUniqueUsername(String username)
focal_class.class_method_signature: IdentityUsernameGenerator.isSearchUniqueUsername(IdmGenerateValueDto valueGenerator)
focal_class.full_signature: protected boolean isSearchUniqueUsername(IdmGenerateValueDto valueGenerator)
focal_class.identifier: isSearchUniqueUsername
focal_class.modifiers: protected
focal_class.parameters: (IdmGenerateValueDto valueGenerator)
focal_class.return: boolean
focal_class.signature: boolean isSearchUniqueUsername(IdmGenerateValueDto valueGenerator)
focal_class.class_method_signature: IdentityUsernameGenerator.getFormAttributes()
focal_class.full_signature: @Override public List<IdmFormAttributeDto> getFormAttributes()
focal_class.identifier: getFormAttributes
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<IdmFormAttributeDto>
focal_class.signature: List<IdmFormAttributeDto> getFormAttributes()
focal_class.superclass: extends AbstractIdentityValueGenerator
focal_method.body: @Override
  	public IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator) {
  		Assert.notNull(dto, "DTO is required.");
  		Assert.notNull(valueGenerator, "Value generator is required.");
  		//
  		// if exists username and configuration doesn't allow regenerate return dto
  		if (!valueGenerator.isRegenerateValue() && StringUtils.isNotEmpty(dto.getUsername())) {
  			return dto;
  		}
  		//
  		String resultUsername = generateUsername(dto, valueGenerator);
  		if (StringUtils.isEmpty(resultUsername)) {
  			return dto;
  		}
  		//
  		if (isSearchUniqueUsername(valueGenerator)) {
  			dto.setUsername(getUniqueUsername(resultUsername));
  		} else {
  			dto.setUsername(resultUsername);
  		}
  		//
  		return dto;
  	}
focal_method.class_method_signature: IdentityUsernameGenerator.generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_method.full_signature: @Override public IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_method.identifier: generate
focal_method.invocations: notNull notNull isRegenerateValue isNotEmpty getUsername generateUsername isEmpty isSearchUniqueUsername setUsername getUniqueUsername setUsername
focal_method.modifiers: @Override public
focal_method.parameters: (IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)
focal_method.return: IdmIdentityDto
focal_method.signature: IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator)