@Test public void testGenerateUpdateActivity() { Activity ret; ret = discussionActivityGenerator.generateUpdateActivity(discussion, discussionDeleted); assertEquals(ret.getAction(), ActivityActionType.DISCARD); ret = discussionActivityGenerator.generateUpdateActivity(discussionDeleted, discussion); assertEquals(ret.getAction(), ActivityActionType.RECOVER); ret = discussionActivityGenerator.generateUpdateActivity(discussion, discussionOtherProject); assertEquals(ret.getAction(), ActivityActionType.MOVE); ret = discussionActivityGenerator.generateUpdateActivity(discussion, discussion); assertEquals(ret.getAction(), ActivityActionType.UPDATE); }
private Activity generateUpdateActivity(Discussion discussion, Discussion modifiedDicussion) { if (!discussion.getProjectId().equals(modifiedDicussion.getProjectId())) { Activity activity = this.generateActivityByActionType(ActivityActionType.MOVE, MOVE_SUBJECT, discussion); ActivityRecorderHelper.setupMoveInformation(discussion.getProjectId(), modifiedDicussion.getProjectId(), activity); return activity; } Activity activity = this.generateActivityByActionType(ActivityActionType.UPDATE, UPDATE_SUBJECT, discussion); return activity; }
DiscussionActivityGenerator implements ActivityGenerator { private Activity generateUpdateActivity(Discussion discussion, Discussion modifiedDicussion) { if (!discussion.getProjectId().equals(modifiedDicussion.getProjectId())) { Activity activity = this.generateActivityByActionType(ActivityActionType.MOVE, MOVE_SUBJECT, discussion); ActivityRecorderHelper.setupMoveInformation(discussion.getProjectId(), modifiedDicussion.getProjectId(), activity); return activity; } Activity activity = this.generateActivityByActionType(ActivityActionType.UPDATE, UPDATE_SUBJECT, discussion); return activity; } }
DiscussionActivityGenerator implements ActivityGenerator { private Activity generateUpdateActivity(Discussion discussion, Discussion modifiedDicussion) { if (!discussion.getProjectId().equals(modifiedDicussion.getProjectId())) { Activity activity = this.generateActivityByActionType(ActivityActionType.MOVE, MOVE_SUBJECT, discussion); ActivityRecorderHelper.setupMoveInformation(discussion.getProjectId(), modifiedDicussion.getProjectId(), activity); return activity; } Activity activity = this.generateActivityByActionType(ActivityActionType.UPDATE, UPDATE_SUBJECT, discussion); return activity; }  }
DiscussionActivityGenerator implements ActivityGenerator { private Activity generateUpdateActivity(Discussion discussion, Discussion modifiedDicussion) { if (!discussion.getProjectId().equals(modifiedDicussion.getProjectId())) { Activity activity = this.generateActivityByActionType(ActivityActionType.MOVE, MOVE_SUBJECT, discussion); ActivityRecorderHelper.setupMoveInformation(discussion.getProjectId(), modifiedDicussion.getProjectId(), activity); return activity; } Activity activity = this.generateActivityByActionType(ActivityActionType.UPDATE, UPDATE_SUBJECT, discussion); return activity; }  @Override String modelType(); @Override Activity generateCreateActivity(BaseProjectItem item); @Override Activity generateUpdateActivity(BaseProjectItem item, BaseProjectItem modifiedItem); @Override BaseProjectItem enrichModel(BaseProjectItem identifiable); @Override String modelService(); }
DiscussionActivityGenerator implements ActivityGenerator { private Activity generateUpdateActivity(Discussion discussion, Discussion modifiedDicussion) { if (!discussion.getProjectId().equals(modifiedDicussion.getProjectId())) { Activity activity = this.generateActivityByActionType(ActivityActionType.MOVE, MOVE_SUBJECT, discussion); ActivityRecorderHelper.setupMoveInformation(discussion.getProjectId(), modifiedDicussion.getProjectId(), activity); return activity; } Activity activity = this.generateActivityByActionType(ActivityActionType.UPDATE, UPDATE_SUBJECT, discussion); return activity; }  @Override String modelType(); @Override Activity generateCreateActivity(BaseProjectItem item); @Override Activity generateUpdateActivity(BaseProjectItem item, BaseProjectItem modifiedItem); @Override BaseProjectItem enrichModel(BaseProjectItem identifiable); @Override String modelService(); static final String CREATE_SUBJECT; static final String DISCARD_SUBJECT; static final String RECOVER_SUBJECT; static final String MOVE_SUBJECT; static final String UPDATE_SUBJECT; }