@Test
public void testRegenerateOff() {

	// prepare identity
	IdmIdentityDto identity = new IdmIdentityDto();
	identity.setUsername(getHelper().createName());
	
	// prepare new form definition
	UUID formDefinitionId = createFormDefinition().getId();
	
	// prepare form attribute 1
	String attrCode1 = getHelper().createName();
	String attrDefaultValue1 = "true";
	IdmFormAttributeDto att1 = createAttribute(attrCode1, attrDefaultValue1, PersistentType.BOOLEAN, formDefinitionId);
	// prepare form attribute 2
	String attrCode2 = getHelper().createName();
	String attrDefaultValue2 = "A";
	IdmFormAttributeDto att2 = createAttribute(attrCode2, attrDefaultValue2, PersistentType.CHAR, formDefinitionId);
	// check eav before
	List<IdmFormInstanceDto> eavs = identity.getEavs();
	assertTrue(eavs.isEmpty());
	// create generator
	ValueGeneratorDto generator = getGenerator();
	this.createGenerator(getDtoType(), getGeneratorType(),
			this.createConfiguration(generator.getFormDefinition(), null), 1, Boolean.FALSE);
	IdmFormDefinitionDto formDefinition = formDefinitionService.get(formDefinitionId);
	IdmFormInstanceDto formInstance = new IdmFormInstanceDto();
	formInstance.setFormDefinition(formDefinition);
	
	// create identity with given one EAV
	String givenNewValue = "false";
	List<IdmFormValueDto> givenValues = new ArrayList<>();
	IdmFormValueDto givenValue = new IdmFormValueDto(att1);
	givenValue.setValue(givenNewValue);
	givenValues.add(givenValue);
	formInstance.setValues(givenValues);
	eavs.add(formInstance);
	identity.setEavs(eavs);
	// generate and check values after
	identity = identityService.save(identity);
	eavs = identity.getEavs();
	assertFalse(eavs.isEmpty());
	
	// get newly generated eav only for given form definition
	IdmFormInstanceDto generatedEav = eavs.stream().filter(eav -> eav.getFormDefinition().getCode().equals(formDefinition.getCode())).findFirst().orElse(null);
	assertNotNull(generatedEav);
	// check values
	List<IdmFormValueDto> values = generatedEav.getValues().stream().filter(val -> val.getFormAttribute().equals(att1.getId())).collect(Collectors.toList());
	assertEquals(1, values.size());
	IdmFormValueDto value = values.get(0);
	// we check manualy given
	assertEquals(givenNewValue, value.getValue().toString());
	values = generatedEav.getValues().stream().filter(val -> val.getFormAttribute().equals(att2.getId())).collect(Collectors.toList());
	assertEquals(1, values.size());
	value = values.get(0);
	assertEquals(attrDefaultValue2, value.getValue().toString());
}