-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Hi,
java-client has a test that looks like this:
@Test(expected = CASMismatchException.class)
public void shouldFailWithInvalidCASOnAppend() {
assumeFalse(CouchbaseTestContext.isMockEnabled());
StringDocument stored = bucket().upsert(StringDocument.create("appendCasMismatch", "foo"));
bucket().append(StringDocument.from(stored, stored.cas() + 1));
}
@Test(expected = CASMismatchException.class)
public void shouldFailWithInvalidCASOnPrepend() {
assumeFalse(CouchbaseTestContext.isMockEnabled());
StringDocument stored = bucket().upsert(StringDocument.create("prependCasMismatch", "foo"));
bucket().prepend(StringDocument.from(stored, stored.cas() + 1));
}So we make sure that if an append or prepend is called with the wrong cas after the upsert, the server fails with a cas mismatch - the mock should too!
Metadata
Metadata
Assignees
Labels
No labels