package gov.nih.nci.cabig.caaers.domain;

/**
 * @author Rhett Sutphin
 */
public class Fixtures {
    public static <T extends DomainObject> T setId(int id, T target) {
        target.setId(id);
        return target;
    }

    public static Participant createParticipant(String first, String last) {
        Participant p = new Participant();
        p.setFirstName(first);
        p.setLastName(last);
        return p;
    }

    public static Study createStudy(String shortTitle) {
        Study s = new Study();
        s.setShortTitle(shortTitle);
        return s;
    }

    public static Site createSite(String name) {
        Site site = new Site();
        site.setName(name);
        return site;
    }

    public static StudyParticipantAssignment assignParticipant(Participant p, Study study, Site site) {
        StudySite ss = new StudySite();
        study.addStudySite(ss);
        site.addStudySite(ss);

        StudyParticipantAssignment assignment = new StudyParticipantAssignment();
        ss.addAssignment(assignment);
        p.addAssignment(assignment);

        return assignment;
    }
}

@@ -703,32 +703,349 @@
 rn site;%0A    %7D%0A%0A
+    /** Creates an assignment and the associated Study, Participant, StudySite, and Site objs */%0A    public static StudyParticipantAssignment createAssignment() %7B%0A        return assignParticipant(%0A            createParticipant(%22D%22, %22C%22),%0A            createStudy(%22DC%22),%0A            createSite(%22N/A%22)%0A        );%0A    %7D%0A%0A
     public stati
@@ -1164,32 +1164,58 @@
 ew StudySite();%0A
+        ss.setSite(site);%0A
         study.ad

Add createAssignment omnibus fixture method