@Test
public void testWhiteSpacesInEmailuSuffixWithReplaceCharacter() {

	String firstName = "firstname-test";
	String lastName = "lastName";
	String username = " use  rna me--";
	String finalUsername = "..use....rna..me--";
	String emailSuffix = " @exam ple.tld";
	String emailSuffixResult = "..@exam..ple.tld";
	IdmIdentityDto identityDto = new IdmIdentityDto();
	identityDto.setFirstName(firstName);
	identityDto.setLastName(lastName);
	identityDto.setUsername(username);
	
	ValueGeneratorDto generator = getGenerator();
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString(),
					IdentityEmailGenerator.REPLACE_WHITE_SPACES_CHARACTER, "..")), 1, null);
	IdmIdentityDto generatedDto = valueGeneratorManager.generate(identityDto);
	assertNotNull(generatedDto.getEmail());
	assertEquals(finalUsername + emailSuffixResult, generatedDto.getEmail());
}