| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
parent directory.. | ||||
Testcontainers module for Couchbase. Couchbase is a document oriented NoSQL database.
Running Couchbase as a stand-in in a test:
public class SomeTest {
@Rule
public CouchbaseContainer couchbase = new CouchbaseContainer()
.withClusterAdmin("admin", "secret")
.withNewBucket(DefaultBucketSettings.builder()
.enableFlush(true)
.name("bucket-name")
.password("secret")
.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
}
}Couchbase container is configured to use random available ports for some ports only, as Couchbase Java SDK permit to configure only some ports :
All other ports cannot be changed by Java SDK, there are sadly fixed :
So if you disable Query, Search and Analytic service, you can run multiple instance of this container, otherwise, you're stuck with one instance, for now.
| Back | FazBrowse Home | New Git URL |