### Question:
QuestionsAndAnswersPlugin extends WebControllerPlugin implements TopicPlugin { @Override public CreateTopicBtnDto getCreateTopicBtnDto(long branchId) { Locale locale = ReadOnlySecurityService.getInstance().getCurrentUser().getLanguage().getLocale(); return new CreateTopicBtnDto("new-question-btn", translateLabel("label.addQuestion", locale), translateLabel("label.addQuestion.tip", locale), CONTEXT + "/new?branchId=" + branchId, order); }  @Override String getName(); @Override List<PluginProperty> getConfiguration(); @Override boolean supportsJCommuneVersion(String version); @Override List<PluginProperty> getDefaultConfiguration(); @Override String translateLabel(String code, Locale locale); @SuppressWarnings("unchecked") @Override List<T> getBranchPermissions(); @Override CreateTopicBtnDto getCreateTopicBtnDto(long branchId); @Override JtalksPermission getCreateTopicPermission(); @Override JtalksPermission getBranchPermissionByMask(int mask); @Override JtalksPermission getBranchPermissionByName(String name); @Override PluginController getController(); @Override String getTopicType(); @Override JtalksPermission getCommentPermission(); @Override SubscribersFilter getSubscribersFilter(); static final String TOPIC_TYPE; static final String CONTEXT; static final String MESSAGE_PATH; }### Answer:
@Test public void testGetCreateTopicBtnDto() { JCUser currentUser = new JCUser("name", "email@example.com", "password"); currentUser.setLanguage(Language.ENGLISH); UserReader userReader = mock(UserReader.class); when(userReader.getCurrentUser()).thenReturn(currentUser); ReadOnlySecurityService service = (ReadOnlySecurityService) ReadOnlySecurityService.getInstance(); service.setUserReader(userReader); CreateTopicBtnDto createTopicBtnDto = new QuestionsAndAnswersPlugin().getCreateTopicBtnDto(1); assertEquals("Ask Question", createTopicBtnDto.getDisplayNameKey()); }