### Question:
TransactionalTopicDraftService implements TopicDraftService, PluginTopicDraftService { @Override @PreAuthorize("isAuthenticated()") public TopicDraft getDraft() { JCUser user = userService.getCurrentUser(); return topicDraftDao.getForUser(user); } TransactionalTopicDraftService(UserService userService,
                                          TopicDraftDao topicDraftDao,
                                          SecurityContextFacade securityContextFacade,
                                          PermissionEvaluator permissionEvaluator,
                                          PluginLoader pluginLoader); @Override @PreAuthorize("isAuthenticated()") TopicDraft getDraft(); @Override @PreAuthorize("( (not #draft.codeReview) and (not #draft.plugable) " + "and hasPermission(#draft.branchId, 'BRANCH', 'BranchPermission.CREATE_POSTS')) " + "or (#draft.codeReview " + "and hasPermission(#draft.branchId, 'BRANCH', 'BranchPermission.CREATE_CODE_REVIEW')) " + " or #draft.plugable") TopicDraft saveOrUpdateDraft(TopicDraft draft); @Override @PreAuthorize("isAuthenticated()") void deleteDraft();  }### Answer:
@Test public void getDraftShouldReturnDraftIfUserHasOne() throws Exception { TopicDraft expectedDraft = createTopicDraft(); when(topicDraftDao.getForUser(currentUser)).thenReturn(expectedDraft); TopicDraft draft = topicDraftService.getDraft(); assertReflectionEquals(draft, expectedDraft); }
@Test public void getDraftShouldReturnNullIfUserHasNoDraft() throws Exception { when(topicDraftDao.getForUser(currentUser)).thenReturn(null); assertNull(topicDraftService.getDraft()); }