Skip to content

Commit

Permalink
fix(ZNTA-2318): reviewdata assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
efloden authored and Alex Eng committed Feb 7, 2018
1 parent 8831920 commit 9d206c8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
Expand Up @@ -32,29 +32,19 @@ public class TranslationReviewService implements TranslationReviewResource {
private static final org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(TranslationReviewService.class);

@Inject
private TextFlowTargetDAO textFlowTargetDAO;
@Inject
private LocaleService localeServiceImpl;
@Inject
private ZanataIdentity identity;
@Inject
private ReviewCriteriaDAO reviewCriteriaDAO;
@Authenticated
@Inject
private HAccount authenticatedAccount;
private TextFlowTargetReviewCommentsDAO textFlowTargetReviewCommentsDAO;

@Inject
public TranslationReviewService(
TextFlowTargetDAO textFlowTargetDAO,
LocaleService localeServiceImpl,
ZanataIdentity identity,
ReviewCriteriaDAO reviewCriteriaDAO,
TextFlowTargetReviewCommentsDAO textFlowTargetReviewCommentsDAO,
@Authenticated HAccount authenticatedAccount) {

this.textFlowTargetDAO = textFlowTargetDAO;
this.localeServiceImpl = localeServiceImpl;
this.identity =identity;
this.reviewCriteriaDAO = reviewCriteriaDAO;
this.textFlowTargetReviewCommentsDAO = textFlowTargetReviewCommentsDAO;
this.authenticatedAccount = authenticatedAccount;
}
private TextFlowTargetReviewCommentsDAO textFlowTargetReviewCommentsDAO;

@Override
public Response put(String localeId, @NotNull ReviewData data) {
Expand Down Expand Up @@ -110,4 +100,26 @@ public Response put(String localeId, @NotNull ReviewData data) {
log.info("success");
return Response.ok(data).build();
}

public TranslationReviewService() {
}

@java.beans.ConstructorProperties({ "textFlowTargetDAO",
"localeServiceImpl", "identity", "reviewCriteriaDAO",
"textFlowTargetReviewCommentsDAO", "authenticatedAccount" })
protected TranslationReviewService(
TextFlowTargetDAO textFlowTargetDAO,
LocaleService localeServiceImpl,
ZanataIdentity identity,
ReviewCriteriaDAO reviewCriteriaDAO,
TextFlowTargetReviewCommentsDAO textFlowTargetReviewCommentsDAO,
HAccount authenticatedAccount) {

this.textFlowTargetDAO = textFlowTargetDAO;
this.localeServiceImpl = localeServiceImpl;
this.identity =identity;
this.reviewCriteriaDAO = reviewCriteriaDAO;
this.textFlowTargetReviewCommentsDAO = textFlowTargetReviewCommentsDAO;
this.authenticatedAccount = authenticatedAccount;
}
}
Expand Up @@ -216,7 +216,7 @@ public void testPut() {
assertThat(response.getStatus())
.isEqualTo(Response.Status.OK.getStatusCode());
assertThat(response.getEntity()).isNotNull();
assertThat((ReviewData) response.getEntity()).isEqualTo(data);
assertThat(response.getEntity()).isEqualTo(data);
}

private HTextFlowTarget buildTft(String localeId, EntityStatus status,
Expand Down

0 comments on commit 9d206c8

Please sign in to comment.