use of org.testcontainers.couchbase.BucketDefinition 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));
}
use of org.testcontainers.couchbase.BucketDefinition 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();
CouchbaseEnvironment environment = DefaultCouchbaseEnvironment.builder().bootstrapCarrierDirectPort(container.getBootstrapCarrierDirectPort()).bootstrapHttpDirectPort(container.getBootstrapHttpDirectPort()).build();
cluster = CouchbaseCluster.create(environment, container.getContainerIpAddress());
cluster.authenticate(container.getUsername(), container.getPassword());
bucket = cluster.openBucket(BUCKET_NAME);
}
Aggregations