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.declarator: scriptService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private IdmScriptService scriptService;
test_class.type: IdmScriptService
test_class.var_name: scriptService
test_class.declarator: scriptAuthorityService
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private IdmScriptAuthorityService scriptAuthorityService;
test_class.type: IdmScriptAuthorityService
test_class.var_name: scriptAuthorityService
test_class.file: Realization/backend/core/core-impl/src/test/java/eu/bcvsolutions/idm/core/generator/identity/IdentityScriptValueGeneratorTest.java
test_class.identifier: IdentityScriptValueGeneratorTest
test_class.superclass: extends AbstractGeneratorTest
test_case.body: @Test
  	public void testGreenLine() {
  		IdmScriptDto script = createScript(
  				"import " + StringUtils.class.getCanonicalName() + ";" + System.lineSeparator() +
  				"if (!valueGenerator.isRegenerateValue() && StringUtils.isNotEmpty(entity.getDescription())) {" + System.lineSeparator() +
  				"	return entity;" + System.lineSeparator() +
  				"}" + System.lineSeparator() +
  				"" + System.lineSeparator() +
  				"entity.setDescription(entity.getUsername() + 123);" + System.lineSeparator());
  		
  		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();
  
  		this.createGenerator(getDtoType(), getGeneratorType(),
  				this.createConfiguration(generator.getFormDefinition(), ImmutableMap.of(
  						IdentityScriptValueGenerator.SCRIPT_CODE, script.getCode())), 1, null);
  
  		IdmIdentityDto generatedDto = valueGeneratorManager.generate(identityDto);
  		assertNotNull(generatedDto.getDescription());
  		assertEquals(username + 123, generatedDto.getDescription());
  	}
test_case.class_method_signature: IdentityScriptValueGeneratorTest.testGreenLine()
test_case.full_signature: @Test public void testGreenLine()
test_case.identifier: testGreenLine
test_case.invocations: createScript getCanonicalName lineSeparator lineSeparator lineSeparator lineSeparator lineSeparator lineSeparator createName getHelper setFirstName createName getHelper setLastName createName getHelper setUsername getGenerator createGenerator getDtoType getGeneratorType createConfiguration getFormDefinition of getCode generate assertNotNull getDescription assertEquals getDescription
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGreenLine()
focal_class.declarator: GENERATOR_NAME = "core-identity-script-value-generator"
focal_class.modifier: public static final
focal_class.original_string: public static final String GENERATOR_NAME = "core-identity-script-value-generator";
focal_class.type: String
focal_class.var_name: GENERATOR_NAME
focal_class.declarator: SCRIPT_CODE = "scriptCode"
focal_class.modifier: public static
focal_class.original_string: public static String SCRIPT_CODE = "scriptCode";
focal_class.type: String
focal_class.var_name: SCRIPT_CODE
focal_class.declarator: ENTITY_KEY = "entity"
focal_class.modifier: public static
focal_class.original_string: public static String ENTITY_KEY = "entity";
focal_class.type: String
focal_class.var_name: ENTITY_KEY
focal_class.declarator: VALUE_GENERATOR_KEY = "valueGenerator"
focal_class.modifier: public static
focal_class.original_string: public static String VALUE_GENERATOR_KEY = "valueGenerator";
focal_class.type: String
focal_class.var_name: VALUE_GENERATOR_KEY
focal_class.declarator: systemScriptEvaluator
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private DefaultSystemScriptEvaluator systemScriptEvaluator;
focal_class.type: DefaultSystemScriptEvaluator
focal_class.var_name: systemScriptEvaluator
focal_class.file: Realization/backend/core/core-impl/src/main/java/eu/bcvsolutions/idm/core/generator/identity/IdentityScriptValueGenerator.java
focal_class.identifier: IdentityScriptValueGenerator
focal_class.class_method_signature: IdentityScriptValueGenerator.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: IdentityScriptValueGenerator.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: IdentityScriptValueGenerator.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: IdentityScriptValueGenerator.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.class_method_signature: IdentityScriptValueGenerator.getScriptCode(IdmGenerateValueDto valueGenerator)
focal_class.full_signature: private String getScriptCode(IdmGenerateValueDto valueGenerator)
focal_class.identifier: getScriptCode
focal_class.modifiers: private
focal_class.parameters: (IdmGenerateValueDto valueGenerator)
focal_class.return: String
focal_class.signature: String getScriptCode(IdmGenerateValueDto valueGenerator)
focal_class.superclass: extends AbstractValueGenerator<IdmIdentityDto>
focal_method.body: @Override
  	public IdmIdentityDto generate(IdmIdentityDto dto, IdmGenerateValueDto valueGenerator) {
  		Assert.notNull(dto, "DTO is required.");
  		Assert.notNull(valueGenerator, "Value generator is required.");
  		//
  		String scriptCode = getScriptCode(valueGenerator);
  		Object returnValue = systemScriptEvaluator.evaluate(new AbstractScriptEvaluator.Builder()
  				.setScriptCode(scriptCode)
  				.addParameter(ENTITY_KEY, dto)
  				.addParameter(VALUE_GENERATOR_KEY, valueGenerator));
  		//
  		if (returnValue == null || !(returnValue instanceof IdmIdentityDto)) {
  			throw new ResultCodeException(CoreResultCode.GENERATOR_SCRIPT_RETURN_NULL_OR_BAD_DTO_TYPE,
  					ImmutableMap.of(
  							"scriptCode", scriptCode == null ? "null" : scriptCode,
  							"returnedValue", returnValue == null ? "null" : returnValue));
  		}
  		//
  		return (IdmIdentityDto) returnValue;
  
  	}
focal_method.class_method_signature: IdentityScriptValueGenerator.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 getScriptCode evaluate addParameter addParameter setScriptCode of
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)