Search in sources :

Example 11 with Cluster

use of com.couchbase.client.java.Cluster in project tutorials by eugenp.

the class StudentServiceIntegrationTest method setupBeforeClass.

@BeforeClass
public static void setupBeforeClass() {
    Cluster cluster = CouchbaseCluster.create(MyCouchbaseConfig.NODE_LIST);
    Bucket bucket = cluster.openBucket(MyCouchbaseConfig.BUCKET_NAME, MyCouchbaseConfig.BUCKET_PASSWORD);
    bucket.upsert(JsonDocument.create(joeCollegeId, jsonJoeCollege));
    bucket.upsert(JsonDocument.create(judyJetsonId, jsonJudyJetson));
    bucket.close();
    cluster.disconnect();
}
Also used : Bucket(com.couchbase.client.java.Bucket) CouchbaseCluster(com.couchbase.client.java.CouchbaseCluster) Cluster(com.couchbase.client.java.Cluster) BeforeClass(org.junit.BeforeClass)

Aggregations

Cluster (com.couchbase.client.java.Cluster)11 Bucket (com.couchbase.client.java.Bucket)6 Test (org.junit.jupiter.api.Test)6 DiagnosticsResult (com.couchbase.client.core.diagnostics.DiagnosticsResult)5 CouchbaseCluster (com.couchbase.client.java.CouchbaseCluster)5 EndpointDiagnostics (com.couchbase.client.core.diagnostics.EndpointDiagnostics)4 ServiceType (com.couchbase.client.core.service.ServiceType)4 List (java.util.List)4 BeforeClass (org.junit.BeforeClass)4 Health (org.springframework.boot.actuate.health.Health)4 Collection (com.couchbase.client.java.Collection)1 CouchbaseEnvironment (com.couchbase.client.java.env.CouchbaseEnvironment)1 DefaultCouchbaseEnvironment (com.couchbase.client.java.env.DefaultCouchbaseEnvironment)1 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)1