Rework referencedata repository integration tests to use test data builder pattern

Description

This ticket was created based on one of the incomplete 3.5 code freeze tasks.

Acceptance Criteria:

  • All repository integration tests in the referencedata service should follow test data builder pattern

Activity

Show:
Paulina Buzderewicz
May 13, 2019, 2:14 PM

I checked the tests and there are some places, where usage of Data Builder pattern was missed:

1.FacilityTypeApprovedProductRepositoryIntegrationTest:

line 140: OrderableDisplayCategory.createNew
line 141: OrderableDisplayValue

2. OrderableRepositoryIntegrationTest:

method: shouldFindOrderablesByProgramCodeIgnoreCase
line 356: Orderable validOrderable = new Orderable

3. ProcessingPeriodRepositoryIntegrationTest:

method: generateRequisitionGroupProgramSchedule
line 323: RequisitionGroupProgramSchedule requisitionGroupProgramSchedule = RequisitionGroupProgramSchedule.newRequisitionGroupProgramSchedule

4. ProgramRepositoryIntegrationTest:
method: persistRightAssignment()
line 353: rightRepository.save(Right.newRight(rightName, RightType.SUPERVISION));

5. RequisitionGroupRepositoryIntegrationTest:
method: generateInstance

6. SupervisoryNodeRepositoryIntegrationTest:
method: shouldSearchByProgramId
line 389: requisitionGroupProgramScheduleRepository.save(RequisitionGroupProgramSchedule.newRequisitionGroupProgramSchedule)

7. SupplyLineRepositoryIntegrationTest:
method: cloneSupplyLine

8. UserRepositoryIntegrationTest:

method: shouldFindUsersByDirectRole
line 384: user1.assignRoles(new DirectRoleAssignment(reportRole, user1),
new DirectRoleAssignment(adminRole, user1));
user2.assignRoles(new DirectRoleAssignment(reportRole, user2));

method: generateFacility
method: generateGeographicLevel
method: generateGeographicZone
method: generateFacilityType
method: saveNewRight
method: saveNewRole

Paulina Buzderewicz
May 16, 2019, 9:36 AM

I checked and now all the repository integration tests in reference data service use the Data Builder pattern, so I’m moving the ticket to Done.

Assignee

Klaudia Pałkowska

Reporter

Klaudia Pałkowska

Labels

Story Points

3

Time tracking

32h

Components

Sprint

None

Fix versions

Priority

Major
Configure