Search in sources :

Example 1 with SubscriptionToken

use of org.springframework.data.couchbase.domain.SubscriptionToken in project spring-data-couchbase by spring-projects.

the class CouchbaseRepositoryKeyValueIntegrationTests method subscriptionToken.

@Test
void subscriptionToken() {
    SubscriptionToken st = new SubscriptionToken("id", 0, "type", "Dave Smith", "app123", "dev123", 0);
    st = subscriptionTokenRepository.save(st);
    st = subscriptionTokenRepository.findById(st.getId()).get();
    GetResult jdkResult = couchbaseTemplate.getCouchbaseClientFactory().getDefaultCollection().get(st.getId());
    assertNotEquals(0, st.getVersion());
    assertEquals(jdkResult.cas(), st.getVersion());
    subscriptionTokenRepository.delete(st);
}
Also used : SubscriptionToken(org.springframework.data.couchbase.domain.SubscriptionToken) GetResult(com.couchbase.client.java.kv.GetResult) Test(org.junit.jupiter.api.Test)

Aggregations

GetResult (com.couchbase.client.java.kv.GetResult)1 Test (org.junit.jupiter.api.Test)1 SubscriptionToken (org.springframework.data.couchbase.domain.SubscriptionToken)1