Пример #1
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();
    pscUserService = registerMockFor(PscUserService.class);
    ssaXmlSerializer = registerNiceMockFor(StudySubjectAssignmentXmlSerializer.class);

    Site nu = createSite("NU", "IL036");
    Study a = createBasicTemplate("A");
    StudySite a_nu = createStudySite(a, nu);
    a_nu.approveAmendment(a.getAmendment(), new Date());
    a_nu_1 = createAssignment(a_nu, createSubject("First", "One"));

    StudySegment ae0s1 = a.getPlannedCalendar().getEpochs().get(0).getStudySegments().get(0);
    ScheduledStudySegment scheduledStudySegment = createScheduledStudySegment(ae0s1);
    a_nu_1.getScheduledCalendar().addStudySegment(scheduledStudySegment);

    jo =
        new PscUserBuilder("jo")
            .add(PscRole.STUDY_SUBJECT_CALENDAR_MANAGER)
            .forAllSites()
            .forAllStudies()
            .toUser();
    alice =
        new PscUserBuilder("alice")
            .add(PscRole.STUDY_SUBJECT_CALENDAR_MANAGER)
            .forAllSites()
            .forAllStudies()
            .toUser();

    setCurrentUser(alice);
    UriTemplateParameters.USERNAME.putIn(request, "jo");
    expect(pscUserService.getAuthorizableUser("jo")).andStubReturn(jo);
    expect(pscUserService.getManagedAssignments(jo, alice))
        .andStubReturn(createExpectedUssars(jo, a_nu_1));
  }
Пример #2
0
  @Override
  protected void setUp() throws Exception {
    super.setUp();

    study = assignIds(createBasicTemplate("CRM 114"));
    for (Epoch e : study.getPlannedCalendar().getEpochs()) {
      for (StudySegment segment : e.getStudySegments()) {
        Period p = createPeriod(1, 1, 1);
        p.addPlannedActivity(createPlannedActivity("T", 1));
        segment.addPeriod(p);
      }
    }
    nu = createSite("NU", "IL675");
    vanderbilt = createSite("VU", "TN054");
    StudySite ss = study.addSite(nu);
    ss.approveAmendment(study.getAmendment(), new Date());
    configuration = registerMockFor(Configuration.class);
  }
Пример #3
0
 public WorkflowMessage getMessage() {
   if (studySite.getAmendmentApprovals().isEmpty()) {
     return workflowMessageFactory.createMessage(WorkflowStep.APPROVE_AMENDMENT, ussr);
   }
   return null;
 }