Testcontainers module for Couchbase. Couchbase is a Document oriented NoSQL database.
See testcontainers.org for more information about Testcontainers.
Running Couchbase as a stand-in in a test:
public class SomeTest {
@Rule
public CouchbaseContainer couchbase = new CouchbaseContainer()
.withNewBucket(DefaultBucketSettings.builder()
.enableFlush(true)
.name('bucket-name')
.quota(100)
.type(BucketType.COUCHBASE)
.build());
@Test
public void someTestMethod() {
Bucket bucket = couchbase.getCouchbaseCluster().openBucket('bucket-name')
... interact with client as if using Couchbase normally
Bucket is cleared after each test
public class SomeTest extends AbstractCouchbaseTest {
@Test
public void someTestMethod() {
Bucket bucket = getBucket();
... interact with client as if using Couchbase normally
Begining from version 1.2, Couchbase testContainer is configured to use random available ports for all ports :
- 8091 : REST/HTTP traffic (bootstrapHttpDirectPort)
- 18091 : REST/HTTP traffic with SSL (bootstrapHttpSslPort)
- 11210 : memcached (bootstrapCarrierDirectPort)
- 11207 : memcached SSL (bootstrapCarrierSslPort)
- 8092 : Queries, views, XDCR
- 8093 : REST/HTTP Query service
- 8094 : REST/HTTP Search Service
- 8095 : REST/HTTP Analytic service