forked from taboola/cassandra-unit
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot Testing Facilities #218
Open
pfrank13
wants to merge
9
commits into
jsevellec:master
Choose a base branch
from
pfrank13:cassandra-unit-spring-boot
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
Really thanks for your the contribution, I'll have a look asap |
pfrank13
force-pushed
the
cassandra-unit-spring-boot
branch
from
February 15, 2017 16:15
6f5d698
to
7160f52
Compare
Now I've created a Spring Boot annotation that uses standard Spring Boot Test facilities for bootstrapping a springboot test. This still requires using the cassandra-unit-spring annotations but that was to POC this, the plan is to remove that requirement and have that functionality be rolled up into the @EmbeddedCassandraTest annotation
Trying to get Spring Data to bootstrap in Spring Data Cassandra properly via AutoConfiguration related boot classes
The test proving out that the Cluster and Session generated works with Spring Data Cassandra on a random port.
Now the configurations that are needed to remove the @EmbeddedCassandra and @CassandraDataSet are available as ConfigurationProperties for the EmbeddedCassandraAutoConfiguration class. The implementation of piping that into Cassandra Daemon, Session and Cluster creation are still not in place.
So technically at this point things work, although the implementation is heavily reliant on side effects that are present in both the AutoConfiguration and static helper class
The closes Spring Boot test annoations for comparison is @DataJpaTest so to match that convention most closely I've changed what I previously called EmbeddedCassandraTest to DataCassandraTest. The expectations closesly map as well which is an embedded datastore is spun up and properly bootstraps Spring Data Cassandra
I needed to exclude Spring Boot's Logging facilities as it was bootstrapping both log4j and logback and logback wasn't found as I had only included log4j
pfrank13
force-pushed
the
cassandra-unit-spring-boot
branch
from
March 14, 2017 21:53
7160f52
to
760c8c0
Compare
You might be interested in my library cassandra-unit-spring that makes testing with Spring Boot/Spring Data a no-brainer. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I created issue #217 that goes over this in more detail. I'd like to point out a few things about the pull request: