Skip to content

Mock does not fail with invalid cas on append and prepend #43

@daschl

Description

@daschl

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions