@Test(expected = RuntimeException.class) public void testSetBackgroundItemsWithInvalidType() { sut.setEnrollmentItems(new ArrayList<BackgroundItem>(), BackgroundItemType.NOT_SET); }
public void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems, final BackgroundItemType inEnrollmentType) { switch (inEnrollmentType) { case AREA_OF_STUDY: setAreasOfStudy(inBackgroundItems); break; case ACTIVITY_OR_SOCIETY: setActivities(inBackgroundItems); break; default: throw new RuntimeException("Invalid enrollment type."); } }
Enrollment extends DomainEntity implements Serializable { public void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems, final BackgroundItemType inEnrollmentType) { switch (inEnrollmentType) { case AREA_OF_STUDY: setAreasOfStudy(inBackgroundItems); break; case ACTIVITY_OR_SOCIETY: setActivities(inBackgroundItems); break; default: throw new RuntimeException("Invalid enrollment type."); } } }
Enrollment extends DomainEntity implements Serializable { public void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems, final BackgroundItemType inEnrollmentType) { switch (inEnrollmentType) { case AREA_OF_STUDY: setAreasOfStudy(inBackgroundItems); break; case ACTIVITY_OR_SOCIETY: setActivities(inBackgroundItems); break; default: throw new RuntimeException("Invalid enrollment type."); } } Enrollment(final Person inPerson, final String inSchoolName, final String inDegree,
            final List<BackgroundItem> inAreasOfStudy, final Date inGradDate,
            final List<BackgroundItem> inActivities, final String inAdditionalDetails); @SuppressWarnings("unused") private  Enrollment(); }
Enrollment extends DomainEntity implements Serializable { public void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems, final BackgroundItemType inEnrollmentType) { switch (inEnrollmentType) { case AREA_OF_STUDY: setAreasOfStudy(inBackgroundItems); break; case ACTIVITY_OR_SOCIETY: setActivities(inBackgroundItems); break; default: throw new RuntimeException("Invalid enrollment type."); } } Enrollment(final Person inPerson, final String inSchoolName, final String inDegree,
            final List<BackgroundItem> inAreasOfStudy, final Date inGradDate,
            final List<BackgroundItem> inActivities, final String inAdditionalDetails); @SuppressWarnings("unused") private  Enrollment(); @JsonIgnore Person getPerson(); void setSchoolName(final String inSchoolName); void setDegree(final String inDegree); void setAreasOfStudy(final List<BackgroundItem> inAreasOfStudy); void setGradDate(final Date inGradDate); void setActivities(final List<BackgroundItem> inActivities); void setAdditionalDetails(final String inAdditionalDetails); String getSchoolName(); String getDegree(); List<BackgroundItem> getAreasOfStudy(); Date getGradDate(); List<BackgroundItem> getActivities(); String getAdditionalDetails(); List<BackgroundItem> getEnrollmentItems(final BackgroundItemType inEnrollmentType); void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems,
            final BackgroundItemType inEnrollmentType); }
Enrollment extends DomainEntity implements Serializable { public void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems, final BackgroundItemType inEnrollmentType) { switch (inEnrollmentType) { case AREA_OF_STUDY: setAreasOfStudy(inBackgroundItems); break; case ACTIVITY_OR_SOCIETY: setActivities(inBackgroundItems); break; default: throw new RuntimeException("Invalid enrollment type."); } } Enrollment(final Person inPerson, final String inSchoolName, final String inDegree,
            final List<BackgroundItem> inAreasOfStudy, final Date inGradDate,
            final List<BackgroundItem> inActivities, final String inAdditionalDetails); @SuppressWarnings("unused") private  Enrollment(); @JsonIgnore Person getPerson(); void setSchoolName(final String inSchoolName); void setDegree(final String inDegree); void setAreasOfStudy(final List<BackgroundItem> inAreasOfStudy); void setGradDate(final Date inGradDate); void setActivities(final List<BackgroundItem> inActivities); void setAdditionalDetails(final String inAdditionalDetails); String getSchoolName(); String getDegree(); List<BackgroundItem> getAreasOfStudy(); Date getGradDate(); List<BackgroundItem> getActivities(); String getAdditionalDetails(); List<BackgroundItem> getEnrollmentItems(final BackgroundItemType inEnrollmentType); void setEnrollmentItems(final List<BackgroundItem> inBackgroundItems,
            final BackgroundItemType inEnrollmentType);  }