Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Srinivasa Vasu <srinivasan.surprise@gmail.com>
- Loading branch information
1 parent
2287c77
commit 47a6e03
Showing
7 changed files
with
48 additions
and
29 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
modules/yugabytedb/src/main/java/org/testcontainers/containers/YCQLSessionDelegate.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,25 @@ | ||
package org.testcontainers.containers; | ||
|
||
import com.datastax.oss.driver.api.core.CqlSession; | ||
|
||
/** | ||
* A builder abstraction to construct {@link CqlSession} instance from | ||
* {@link YugabyteDBYCQLContainer} instance. | ||
* | ||
* @author srinivasa-vasu | ||
*/ | ||
public interface YCQLSessionDelegate { | ||
|
||
/** | ||
* Constructs a {@link CqlSession} instance from {@link YugabyteDBYCQLContainer} | ||
* instance. | ||
* @param container YCQL container instance | ||
* @return {@link CqlSession} instance | ||
*/ | ||
default CqlSession builder(YugabyteDBYCQLContainer container) { | ||
return CqlSession.builder().withLocalDatacenter(container.getLocalDc()).withKeyspace(container.getKeyspace()) | ||
.withAuthCredentials(container.getUsername(), container.getPassword()) | ||
.addContactPoint(container.getContactPoint()).build(); | ||
} | ||
|
||
} |
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
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
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