Srikar
Srikar

Reputation: 371

Using 2 buckets inside test container for couchbase in spring boot application

We are trying to write integration tests for our usecase where we have 2 buckets in couchbase database and I am trying to create test container with those 2 buckets. I have something like

new CouchbaseContainer(dockerImage)
                    .withBucket(new BucketDefinition(getBucketName()))
                    .withBucket(new BucketDefinition(getNewBucketName()))
                    .withCredentials("admin", "password123")
                    .withServiceQuota(CouchbaseService.SEARCH, 1024)
                    .withStartupTimeout(Duration.ofMinutes(15));
            

Here I am using .withBucket() to create buckets, for single bucket it is working but when I try to create a new bucket it is throwing errors when executing .n1ql files which we are using for creating the base configuration to the first bucket.

It is throwing errors like

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'couchmove' defined in class path resource [DatabaseConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.couchmove.Couchmove]: Factory method 'couchmove' threw exception; nested exception is com.github.couchmove.exception.CouchmoveException: Unable to migrate

Is using .withBucket() the right way to create 2nd bucket?

Upvotes: 1

Views: 225

Answers (0)

Related Questions