Package org.zanata.webtrans.shared.rpc

Examples of org.zanata.webtrans.shared.rpc.AddReviewCommentResult


        AddReviewComment commentEvent = new AddReviewComment(
                new TransUnitId(hTextFlowTarget.getTextFlow().getId()),
                hTextFlowTarget.getReviewComments().size());
        workspace.publish(commentEvent);
        return new AddReviewCommentResult(toDTO(hComment));
    }
View Full Code Here


        when(hTextFlowTarget.addReviewComment(commentContent, hPerson))
                .thenReturn(hReviewComment);
        when(hReviewComment.getId()).thenReturn(1L);

        // When:
        AddReviewCommentResult result = handler.execute(action, null);

        // Then:
        InOrder inOrder =
                Mockito.inOrder(textFlowTargetDAO,
                        textFlowTargetReviewCommentsDAO,
                        hTextFlowTarget, workspace,
                        securityServiceImpl, identity);
        inOrder.verify(securityServiceImpl).checkWorkspaceStatus(
                action.getWorkspaceId());
        inOrder.verify(textFlowTargetDAO).getTextFlowTarget(
                transUnitId.getValue(), hLocale.getLocaleId());
        inOrder.verify(identity).checkPermission("review-comment", hLocale,
                hProject);
        inOrder.verify(hTextFlowTarget).addReviewComment(commentContent,
                hPerson);
        inOrder.verify(textFlowTargetReviewCommentsDAO).flush();
        inOrder.verify(workspace).publish(isA(AddReviewComment.class));

        assertThat(result.getComment().getId(),
                Matchers.equalTo(new ReviewCommentId(1L)));
    }
View Full Code Here

        assertThat(actionCaptor.getValue().getContent(),
                Matchers.equalTo("some comment"));

        AsyncCallback<AddReviewCommentResult> callback =
                resultCaptor.getValue();
        AddReviewCommentResult result =
                new AddReviewCommentResult(new ReviewComment());
        callback.onSuccess(result);

        verify(display).addCommentToList(result.getComment());
        verify(display).clearInput();
    }
View Full Code Here

        assertThat(actionCaptor.getValue().getContent(),
                Matchers.equalTo("i hate this"));

        AsyncCallback<AddReviewCommentResult> callback =
                resultCaptor.getValue();
        AddReviewCommentResult result =
                new AddReviewCommentResult(new ReviewComment());
        callback.onSuccess(result);

        verify(display).clearInput();
        verify(eventBus).fireEvent(saveEvent);
        verify(eventBus).fireEvent(NavTransUnitEvent.NEXT_ENTRY_EVENT);
View Full Code Here

TOP

Related Classes of org.zanata.webtrans.shared.rpc.AddReviewCommentResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.