Search in sources :

Example 1 with ClusterOptions

use of com.couchbase.client.java.ClusterOptions in project ShedLock by lukas-krecan.

the class CouchbaseLockProviderIntegrationTest method startCouchbase.

@BeforeAll
public static void startCouchbase() {
    container = new CouchbaseContainer().withBucket(new BucketDefinition(BUCKET_NAME));
    container.start();
    Set<SeedNode> seedNodes = new HashSet<>(Arrays.asList(SeedNode.create(container.getContainerIpAddress(), Optional.of(container.getBootstrapCarrierDirectPort()), Optional.of(container.getBootstrapHttpDirectPort()))));
    ClusterOptions options = ClusterOptions.clusterOptions(container.getUsername(), container.getPassword());
    cluster = Cluster.connect(seedNodes, options);
    bucket = cluster.bucket(BUCKET_NAME);
    bucket.waitUntilReady(Duration.ofSeconds(30));
}
Also used : BucketDefinition(org.testcontainers.couchbase.BucketDefinition) SeedNode(com.couchbase.client.core.env.SeedNode) CouchbaseContainer(org.testcontainers.couchbase.CouchbaseContainer) HashSet(java.util.HashSet) ClusterOptions(com.couchbase.client.java.ClusterOptions) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

SeedNode (com.couchbase.client.core.env.SeedNode)1 ClusterOptions (com.couchbase.client.java.ClusterOptions)1 HashSet (java.util.HashSet)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 BucketDefinition (org.testcontainers.couchbase.BucketDefinition)1 CouchbaseContainer (org.testcontainers.couchbase.CouchbaseContainer)1