public ActivityOfferingInfo testCRUDActivityOffering(FormatOfferingInfo fo) throws DoesNotExistException, InvalidParameterException, MissingParameterException, OperationFailedException, PermissionDeniedException, DataValidationErrorException, ReadOnlyException, VersionMismatchException { ActivityOfferingInfo orig = new ActivityOfferingInfo(); orig.setFormatOfferingId(fo.getId()); orig.setActivityId(fo.getId() + "." + LuServiceConstants.COURSE_ACTIVITY_LECTURE_TYPE_KEY); orig.setTypeKey(LuiServiceConstants.LECTURE_ACTIVITY_OFFERING_TYPE_KEY); orig.setStateKey(LuiServiceConstants.LUI_AO_STATE_DRAFT_KEY); orig.setMinimumEnrollment(100); orig.setMaximumEnrollment(150); orig.setIsEvaluated(true); orig.setIsMaxEnrollmentEstimate(false); orig.setIsHonorsOffering(true); ActivityOfferingInfo info = courseOfferingService.createActivityOffering( orig.getFormatOfferingId(), orig.getActivityId(), orig.getTypeKey(), orig, callContext); assertNotNull(info); assertNotNull(info.getId()); assertEquals(orig.getStateKey(), info.getStateKey()); assertEquals(orig.getTypeKey(), info.getTypeKey()); assertEquals(orig.getFormatOfferingId(), info.getFormatOfferingId()); assertEquals(orig.getActivityId(), info.getActivityId()); assertEquals(orig.getMinimumEnrollment(), info.getMinimumEnrollment()); assertEquals(orig.getMaximumEnrollment(), info.getMaximumEnrollment()); assertEquals(orig.getIsEvaluated(), info.getIsEvaluated()); assertEquals(orig.getIsMaxEnrollmentEstimate(), info.getIsMaxEnrollmentEstimate()); assertEquals(orig.getIsHonorsOffering(), info.getIsHonorsOffering()); orig = info; info = courseOfferingService.getActivityOffering(orig.getId(), callContext); assertNotNull(info); assertEquals(orig.getId(), info.getId()); assertEquals(orig.getStateKey(), info.getStateKey()); assertEquals(orig.getTypeKey(), info.getTypeKey()); assertEquals(orig.getFormatOfferingId(), info.getFormatOfferingId()); assertEquals(orig.getActivityId(), info.getActivityId()); assertEquals(orig.getMinimumEnrollment(), info.getMinimumEnrollment()); assertEquals(orig.getMaximumEnrollment(), info.getMaximumEnrollment()); orig = info; orig.setMinimumEnrollment(100); info = courseOfferingService.updateActivityOffering(orig.getId(), orig, callContext); assertNotNull(info); assertEquals(orig.getId(), info.getId()); assertEquals(orig.getStateKey(), info.getStateKey()); assertEquals(orig.getTypeKey(), info.getTypeKey()); assertEquals(orig.getFormatOfferingId(), info.getFormatOfferingId()); assertEquals(orig.getActivityId(), info.getActivityId()); assertEquals(orig.getMinimumEnrollment(), info.getMinimumEnrollment()); assertEquals(orig.getMaximumEnrollment(), info.getMaximumEnrollment()); return info; }