test_class.declarator: reportExecutor
test_class.modifier: @Autowired 
  	private
test_class.original_string: @Autowired 
  	private IdentityRoleByIdentityDeduplicationExecutor reportExecutor;
test_class.type: IdentityRoleByIdentityDeduplicationExecutor
test_class.var_name: reportExecutor
test_class.declarator: mapper
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private ObjectMapper mapper;
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: attachmentManager
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private AttachmentManager attachmentManager;
test_class.type: AttachmentManager
test_class.var_name: attachmentManager
test_class.declarator: xlsxRenderer
test_class.modifier: @Autowired
  	private
test_class.original_string: @Autowired
  	private IdentityRoleByIdentityDeduplicationXlsxRenderer xlsxRenderer;
test_class.type: IdentityRoleByIdentityDeduplicationXlsxRenderer
test_class.var_name: xlsxRenderer
test_class.file: Realization/backend/rpt/rpt-impl/src/test/java/eu/bcvsolutions/idm/rpt/report/identity/IdentityRoleByIdentityDeduplicationExecutorTest.java
test_class.identifier: IdentityRoleByIdentityDeduplicationExecutorTest
test_class.superclass: extends AbstractIntegrationTest
test_case.body: @Test
  	public void testExecuteReportOneContractMoreRolesWithValidity() throws JsonParseException, JsonMappingException, IOException {
  		String roleCode = "test-" + System.currentTimeMillis(); 
  		IdmTreeNodeDto treeNode = getHelper().createTreeNode();
  		IdmIdentityDto identity = getHelper().createIdentity(new GuardedString());
  		IdmIdentityContractDto contact = getHelper().createContract(identity, treeNode);
  		
  		IdmRoleDto role = getHelper().createRole(roleCode);
  
  		getHelper().createIdentityRole(contact, role, LocalDate.now().minusDays(40), LocalDate.now().plusDays(40));
  		getHelper().createIdentityRole(contact, role, LocalDate.now().minusDays(30), LocalDate.now().plusDays(30));
  		getHelper().createIdentityRole(contact, role, LocalDate.now().minusDays(20), LocalDate.now().plusDays(20));
  		getHelper().createIdentityRole(contact, role, LocalDate.now().minusDays(10), LocalDate.now().plusDays(10));
  
  		RptReportDto report = new RptReportDto(UUID.randomUUID());
  		report.setExecutorName(reportExecutor.getName());
  		IdmFormDto filter = new IdmFormDto();
  		IdmFormDefinitionDto definition = reportExecutor.getFormDefinition();
  		IdmFormValueDto treeNodeParameter = new IdmFormValueDto(definition.getMappedAttributeByCode(IdentityRoleByIdentityDeduplicationExecutor.PARAMETER_TREE_NODE));
  		treeNodeParameter.setValue(treeNode.getId());
  		filter.getValues().add(treeNodeParameter);
  		filter.setFormDefinition(definition.getId());
  		report.setFilter(filter);
  
  		report = reportExecutor.generate(report);
  		Assert.assertNotNull(report.getData());
  		List<RptIdentityRoleByRoleDeduplicationDto> reportItems = mapper.readValue(
  				attachmentManager.getAttachmentData(report.getData()), 
  				new TypeReference<List<RptIdentityRoleByRoleDeduplicationDto>>(){});
  
  		assertEquals(1, reportItems.size());
  		RptIdentityRoleByRoleDeduplicationDto item = reportItems.get(0);
  
  		List<RptIdentityRoleByRoleDeduplicationDuplicityDto> duplicities = item.getDuplicity();
  		assertEquals(3, duplicities.size());
  		for (RptIdentityRoleByRoleDeduplicationDuplicityDto duplicity : duplicities) {
  			assertEquals(role.getId(), duplicity.getRole().getId());
  			if (duplicity.getValidTill().isEqual(duplicity.getValidFrom())) {
  				fail();
  			}
  			if (!duplicity.getValidTill().isBefore(LocalDate.now().plusDays(35))) {
  				fail();
  			}
  			if (!duplicity.getValidFrom().isAfter(LocalDate.now().minusDays(35))) {
  				fail();
  			}
  		}
  
  		attachmentManager.deleteAttachments(report);
  	}
test_case.class_method_signature: IdentityRoleByIdentityDeduplicationExecutorTest.testExecuteReportOneContractMoreRolesWithValidity()
test_case.full_signature: @Test public void testExecuteReportOneContractMoreRolesWithValidity()
test_case.identifier: testExecuteReportOneContractMoreRolesWithValidity
test_case.invocations: currentTimeMillis createTreeNode getHelper createIdentity getHelper createContract getHelper createRole getHelper createIdentityRole getHelper minusDays now plusDays now createIdentityRole getHelper minusDays now plusDays now createIdentityRole getHelper minusDays now plusDays now createIdentityRole getHelper minusDays now plusDays now randomUUID setExecutorName getName getFormDefinition getMappedAttributeByCode setValue getId add getValues setFormDefinition getId setFilter generate assertNotNull getData readValue getAttachmentData getData assertEquals size get getDuplicity assertEquals size assertEquals getId getId getRole isEqual getValidTill getValidFrom fail isBefore getValidTill plusDays now fail isAfter getValidFrom minusDays now fail deleteAttachments
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteReportOneContractMoreRolesWithValidity()
focal_class.declarator: LOG = org.slf4j.LoggerFactory
  			.getLogger(IdentityRoleByIdentityDeduplicationExecutor.class)
focal_class.modifier: private static final
focal_class.original_string: private static final org.slf4j.Logger LOG = org.slf4j.LoggerFactory
  			.getLogger(IdentityRoleByIdentityDeduplicationExecutor.class);
focal_class.type: org.slf4j.Logger
focal_class.var_name: LOG
focal_class.declarator: REPORT_NAME = "identity-role-by-identity-deduplication-report"
focal_class.modifier: public static final
focal_class.original_string: public static final String REPORT_NAME = "identity-role-by-identity-deduplication-report";
focal_class.type: String
focal_class.var_name: REPORT_NAME
focal_class.declarator: PARAMETER_TREE_NODE = "treeNode"
focal_class.modifier: public static final
focal_class.original_string: public static final String PARAMETER_TREE_NODE = "treeNode";
focal_class.type: String
focal_class.var_name: PARAMETER_TREE_NODE
focal_class.declarator: deduplicationBulkAction
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private IdentityRoleByIdentityDeduplicationBulkAction deduplicationBulkAction;
focal_class.type: IdentityRoleByIdentityDeduplicationBulkAction
focal_class.var_name: deduplicationBulkAction
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.declarator: identityContractService
focal_class.modifier: @Autowired
  	private
focal_class.original_string: @Autowired
  	private IdmIdentityContractService identityContractService;
focal_class.type: IdmIdentityContractService
focal_class.var_name: identityContractService
focal_class.file: Realization/backend/rpt/rpt-impl/src/main/java/eu/bcvsolutions/idm/rpt/report/identity/IdentityRoleByIdentityDeduplicationExecutor.java
focal_class.identifier: IdentityRoleByIdentityDeduplicationExecutor
focal_class.class_method_signature: IdentityRoleByIdentityDeduplicationExecutor.generateData(RptReportDto report)
focal_class.full_signature: @Override protected IdmAttachmentDto generateData(RptReportDto report)
focal_class.identifier: generateData
focal_class.modifiers: @Override protected
focal_class.parameters: (RptReportDto report)
focal_class.return: IdmAttachmentDto
focal_class.signature: IdmAttachmentDto generateData(RptReportDto report)
focal_class.class_method_signature: IdentityRoleByIdentityDeduplicationExecutor.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: IdentityRoleByIdentityDeduplicationExecutor.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: IdentityRoleByIdentityDeduplicationExecutor.getTreeNode(RptReportDto report)
focal_class.full_signature: private UUID getTreeNode(RptReportDto report)
focal_class.identifier: getTreeNode
focal_class.modifiers: private
focal_class.parameters: (RptReportDto report)
focal_class.return: UUID
focal_class.signature: UUID getTreeNode(RptReportDto report)
focal_class.class_method_signature: IdentityRoleByIdentityDeduplicationExecutor.createRecordForContracts(IdmIdentityContractDto contract)
focal_class.full_signature: private RptIdentityRoleByRoleDeduplicationDto createRecordForContracts(IdmIdentityContractDto contract)
focal_class.identifier: createRecordForContracts
focal_class.modifiers: private
focal_class.parameters: (IdmIdentityContractDto contract)
focal_class.return: RptIdentityRoleByRoleDeduplicationDto
focal_class.signature: RptIdentityRoleByRoleDeduplicationDto createRecordForContracts(IdmIdentityContractDto contract)
focal_class.superclass: extends AbstractReportExecutor
focal_method.body: @Override
  	public String getName() {
  		return REPORT_NAME;
  	}
focal_method.class_method_signature: IdentityRoleByIdentityDeduplicationExecutor.getName()
focal_method.full_signature: @Override public String getName()
focal_method.identifier: getName
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: String
focal_method.signature: String getName()