Search in sources :

Example 1 with DocumentConflictException

use of com.cloudant.client.org.lightcouch.DocumentConflictException in project java-cloudant by cloudant.

the class ResponseTest method verifyDocumentConflict.

@Test
public void verifyDocumentConflict() {
    try {
        Response response = db.save(foo);
        assertEquals(2, response.getStatusCode() / 100);
        db.save(foo);
        fail("A DocumentConflictException should be thrown");
    } catch (DocumentConflictException e) {
        exceptionAsserts(e, 409, "");
    }
}
Also used : Response(com.cloudant.client.api.model.Response) DocumentConflictException(com.cloudant.client.org.lightcouch.DocumentConflictException) Test(org.junit.jupiter.api.Test)

Aggregations

Response (com.cloudant.client.api.model.Response)1 DocumentConflictException (com.cloudant.client.org.lightcouch.DocumentConflictException)1 Test (org.junit.jupiter.api.Test)1