Skip to content

Commit

Permalink
Merge pull request #38 from rchodava/add-conflict-responses
Browse files Browse the repository at this point in the history
Added conflict response.
  • Loading branch information
israelcolomer committed May 18, 2016
2 parents d2df308 + fdeba2e commit 0a4a59a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ public interface ResponseBuilder {
Response unauthorized(String content);
Response forbidden();
Response forbidden(String content);
Response conflict(String content);
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,9 @@ public Response forbidden() {
public Response forbidden(String content) {
return new ResponseImpl(Status.FORBIDDEN, headers, new ValueEntity(new StringValue(content)));
}

@Override
public Response conflict(String content) {
return new ResponseImpl(Status.CONFLICT, headers, new ValueEntity(new StringValue(content)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public void responseCodes() {
assertEquals(Status.FORBIDDEN, builder.forbidden().status());
assertEquals(Status.FORBIDDEN, builder.forbidden("Content").status());
assertEquals("Content", builder.forbidden("Content").entity().asString().toBlocking().last());
assertEquals(Status.CONFLICT, builder.conflict("Content").status());
assertEquals("Content", builder.conflict("Content").entity().asString().toBlocking().last());
}

@Test
Expand Down

0 comments on commit 0a4a59a

Please sign in to comment.