@Test
public void testDisable() {

	String emailSuffix = "ex.tld";
	String emailSuffix1 = "@test.tld";
	String emailSuffix2 = "bcvsolutions.tld";
	String username = this.getHelper().createName();
	IdmIdentityDto identityDto = new IdmIdentityDto();
	identityDto.setFirstName(this.getHelper().createName());
	identityDto.setLastName(this.getHelper().createName());
	identityDto.setUsername(username);
	
	ValueGeneratorDto generator = getGenerator();
	// first - this generator will be generate email
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString())), 10, null);
	// second
	IdmGenerateValueDto createGenerator = this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix1,
					IdentityEmailGenerator.GENERATE_FROM_USERNAME, Boolean.TRUE.toString())), 20, null);
	createGenerator.setDisabled(true);
	this.generatedAttributeService.save(createGenerator);
	// the last
	createGenerator = this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
					IdentityEmailGenerator.EMAIL_SUFFIX, emailSuffix2)), 30, null);
	createGenerator.setDisabled(true);
	this.generatedAttributeService.save(createGenerator);
	IdmIdentityDto generatedDto = valueGeneratorManager.generate(identityDto);
	assertNotNull(generatedDto.getEmail());
	assertEquals(username + "@" + emailSuffix, generatedDto.getEmail());
}