-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow configuration of user settings to support couchbase community v…
…ersion (#777)
- Loading branch information
Showing
3 changed files
with
79 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
modules/couchbase/src/test/java/org/testcontainers/couchbase/CouchbaseCommunity5_1Test.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.testcontainers.couchbase; | ||
|
||
import java.util.Collections; | ||
|
||
import org.junit.ClassRule; | ||
|
||
import com.couchbase.client.java.cluster.UserRole; | ||
import com.couchbase.client.java.cluster.UserSettings; | ||
|
||
public class CouchbaseCommunity5_1Test extends BaseCouchbaseContainerTest { | ||
@ClassRule | ||
public static CouchbaseContainer container = initCouchbaseContainer(); | ||
|
||
private static CouchbaseContainer initCouchbaseContainer() { | ||
CouchbaseContainer couchbaseContainer = new CouchbaseContainer("couchbase/server:community-5.1.1"); | ||
|
||
final UserSettings communityAdminUserSettings = | ||
UserSettings.build() | ||
.password(getDefaultBucketSettings().password()) | ||
.roles(Collections.singletonList(new UserRole("admin"))); | ||
|
||
couchbaseContainer.withNewBucket(getDefaultBucketSettings(), communityAdminUserSettings); | ||
couchbaseContainer.start(); | ||
return couchbaseContainer; | ||
} | ||
|
||
@Override | ||
public CouchbaseContainer getCouchbaseContainer() { | ||
return container; | ||
} | ||
} |