Testcontainers module for Couchbase. Couchbase is a NoSQL document Database.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
release
src Add compatibility with Couchbase 5.5 Aug 23, 2018
.gitignore
.travis.yml Add support for automatic release via Travis Jul 3, 2017
LICENSE Initial commit Jun 18, 2017
README.md Update README.md Aug 23, 2018
pom.xml

README.md

TestContainers Couchbase Module

Testcontainers module for Couchbase. Couchbase is a Document oriented NoSQL database.

See testcontainers.org for more information about Testcontainers.

Usage example

Running Couchbase as a stand-in in a test:

Create you own bucket

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

Use preconfigured default bucket

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

Special consideration

Begining from version 1.2, Couchbase testContainer is configured to use random available ports for all ports :


Build Status Maven Central Licence