Hello. I am migrating my application from couchbase 2 to couchbase 3 client. In the past my entire functional test suite was integrated with couchbase-mock. After switching to new client API I can’t figure out how to make my application client connect to couchbase mock instance. My version 2 test setup created cluster instance as follows:
cluster = CouchbaseCluster.create(DefaultCouchbaseEnvironment.builder()
.bootstrapCarrierDirectPort(carrierPort)
.bootstrapHttpDirectPort(couchbaseMock.getHttpPort())
.build(), “couchbase://127.0.0.1”);
Version 3 API changed significantly and following implementation does not work for me:
ClusterEnvironment env = ClusterEnvironment.builder().build();
Set seedNodes = new HashSet<>(
Arrays.asList(SeedNode.create(“localhost”, Optional.of(httpPort), Optional.empty()),
SeedNode.create(“localhost”, Optional.of(carrierPort), Optional.empty())));
cluster = Cluster.connect(“localhost”, ClusterOptions.clusterOptions(bucketName, password).environment(env));
When I start my tests I receive errors when accessing bucket:
Connection refused: localhost/127.0.0.1:8091 - Check server ports and cluster encryption setting.
Connection refused: localhost/127.0.0.1:11210 - Check server ports and cluster encryption setting.
Can client 3 application be tested using couchbase-mock? If not what are other couchbase testing APIs that support functional test implementations?