Skip to content

Commit

Permalink
fix: Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
larshelge committed Jun 22, 2024
1 parent 5e465f2 commit c4fbe42
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.hisp.dhis.category.CategoryOptionCombo;
import org.hisp.dhis.category.CategoryService;
import org.hisp.dhis.common.CodeGenerator;
import org.hisp.dhis.note.Note;
import org.hisp.dhis.note.NoteService;
Expand Down Expand Up @@ -72,10 +74,14 @@ class EnrollmentServiceTest extends TransactionalIntegrationTest {

@Autowired private NoteService noteService;

@Autowired private CategoryService categoryService;

private Date incidentDate;

private Date enrollmentDate;

private CategoryOptionCombo coA;

private Program programA;

private Program programB;
Expand Down Expand Up @@ -104,6 +110,8 @@ class EnrollmentServiceTest extends TransactionalIntegrationTest {
public void setUpTest() {
userService = _userService;

coA = categoryService.getDefaultCategoryOptionCombo();

organisationUnitA = createOrganisationUnit('A');
organisationUnitService.addOrganisationUnit(organisationUnitA);
organisationUnitB = createOrganisationUnit('B');
Expand Down Expand Up @@ -146,9 +154,6 @@ public void setUpTest() {
enrollmentA = new Enrollment(enrollmentDate, incidentDate, trackedEntityA, programA);
enrollmentA.setUid("UID-A");
enrollmentA.setOrganisationUnit(organisationUnitA);
eventA =
eventService.createEvent(
enrollmentA, stageA, enrollmentDate, incidentDate, organisationUnitA);
enrollmentB = new Enrollment(enrollmentDate, incidentDate, trackedEntityA, programB);
enrollmentB.setUid("UID-B");
enrollmentB.setStatus(EnrollmentStatus.CANCELLED);
Expand All @@ -160,6 +165,10 @@ public void setUpTest() {
enrollmentD = new Enrollment(enrollmentDate, incidentDate, trackedEntityB, programA);
enrollmentD.setUid("UID-D");
enrollmentD.setOrganisationUnit(organisationUnitB);
eventA = new Event(enrollmentA, stageA);
eventA.setUid("UID-PSI-A");
eventA.setOrganisationUnit(organisationUnitA);
eventA.setAttributeOptionCombo(coA);

injectSecurityContextUser(user);
}
Expand Down

0 comments on commit c4fbe42

Please sign in to comment.