-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests and documentation for datastax driver SSL integration (#403)
closes #2
- Loading branch information
Showing
30 changed files
with
2,103 additions
and
112 deletions.
There are no files selected for viewing
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
The Cassandra DataStax Java Driver includes https://docs.datastax.com/en/developer/java-driver/latest/manual/core/ssl/#driver-configuration[support for SSL], to secure traffic between the driver and Cassandra. | ||
|
||
This an example of additional configuration for Micronaut Cassandra that enables SSL connections. The relevant values are defined under the `cassandra.\*.advanced.ssl-engine-factory.*` property key and documented further in the https://docs.datastax.com/en/developer/java-driver/latest/manual/core/configuration/reference/[Datastax Configuration Reference]. | ||
|
||
[configuration] | ||
---- | ||
cassandra: | ||
default: | ||
advanced: | ||
ssl-engine-factory: | ||
class: DefaultSslEngineFactory | ||
truststore-path: <path to trust store> | ||
truststore-password: <password> | ||
---- | ||
|
||
- `class`: The class of the factory. `DefaultSslEngineFactory` is the default built-in implementation | ||
- `truststore` properties: these are optional and if not present system property configuration is used instead | ||
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
12 changes: 12 additions & 0 deletions
12
...dra-micrometer/src/test/groovy/io/micronaut/cassandra/micrometertest/CassandraInfo.groovy
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,12 @@ | ||
package io.micronaut.cassandra.micrometertest | ||
|
||
import groovy.transform.Canonical | ||
import io.micronaut.core.annotation.Introspected | ||
|
||
@Canonical | ||
@Introspected | ||
class CassandraInfo { | ||
|
||
String clusterName | ||
String releaseVersion | ||
} |
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 was deleted.
Oops, something went wrong.
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,28 @@ | ||
plugins { | ||
id("io.micronaut.test-resources") | ||
id("io.micronaut.build.internal.cassandra-native-tests") | ||
} | ||
|
||
micronaut { | ||
importMicronautPlatform = false | ||
testRuntime("junit5") | ||
enableNativeImage(false) | ||
processing { | ||
incremental(true) | ||
annotations("io.micronaut.cassandra.graaltest") | ||
} | ||
testResources { | ||
clientTimeout = 600 | ||
} | ||
} | ||
|
||
dependencies { | ||
testImplementation(projects.micronautCassandra) | ||
|
||
testImplementation(mn.micronaut.context) | ||
testImplementation(mn.micronaut.jackson.databind) | ||
testImplementation(mnTest.micronaut.test.junit5) | ||
|
||
testRuntimeOnly(mn.snakeyaml) | ||
testRuntimeOnly(mnLogging.logback.classic) | ||
} |
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
7 changes: 5 additions & 2 deletions
7
.../src/test/java/example/CassandraTest.java → ...ut/cassandra/graaltest/CassandraTest.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 |
---|---|---|
@@ -1,16 +1,19 @@ | ||
package example; | ||
package io.micronaut.cassandra.graaltest; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import io.micronaut.context.annotation.Property; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import io.micronaut.test.extensions.junit5.annotation.MicronautTest; | ||
|
||
@MicronautTest | ||
@Property(name = "spec.name", value = "CassandraTest") | ||
class CassandraTest { | ||
|
||
@Test | ||
void testCassandra(CassandraRepository repository) { | ||
assertTrue(repository.getInfo().isPresent()); | ||
} | ||
|
||
} | ||
} |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,27 @@ | ||
plugins { | ||
groovy | ||
id("io.micronaut.build.internal.cassandra-tests") | ||
} | ||
|
||
dependencies { | ||
testImplementation(projects.micronautCassandra) | ||
testImplementation(mn.micronaut.http.client) | ||
testImplementation(mn.micronaut.jackson.databind) | ||
testImplementation(mn.micronaut.management) | ||
testImplementation(mnReactor.micronaut.reactor) | ||
|
||
testImplementation(libs.testcontainers.spock) | ||
testImplementation(libs.testcontainers.cassandra) | ||
|
||
testRuntimeOnly(mnLogging.logback.classic) | ||
} | ||
|
||
micronaut { | ||
version.set(libs.versions.micronaut.platform.get()) | ||
runtime("netty") | ||
testRuntime("spock2") | ||
processing { | ||
incremental(true) | ||
annotations("example.*") | ||
} | ||
} |
Oops, something went wrong.