Skip to content
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

Add TestCassandraBuilder to build TestCassandra, CassandraRule and CassandraExtension #37

Closed
nosan opened this issue Jun 26, 2019 · 0 comments
Assignees
Labels
enhancement A general enhancement
Milestone

Comments

@nosan
Copy link
Owner

nosan commented Jun 26, 2019

//junit4 Rule
	@ClassRule
	public static final CassandraRule cassandra = new TestCassandraBuilder()
			.scripts(CqlScript.classpath("init.cql"))
			.connectionFactory(new CqlSessionConnectionFactory())
			.cassandraFactory(() -> {
				LocalCassandraFactory factory = new LocalCassandraFactory();
				factory.setVersion("3.11.3");
				return factory.create();
			}).build(CassandraRule.class);

//junit5 extensions

	@RegisterExtension
 static final CassandraExtension cassandra = new TestCassandraBuilder()
			.scripts(CqlScript.classpath("init.cql"))
			.connectionFactory(new CqlSessionConnectionFactory())
			.cassandraFactory(() -> {
				LocalCassandraFactory factory = new LocalCassandraFactory();
				factory.setVersion("3.11.3");
				return factory.create();
			}).build(CassandraExtension.class);

//test cassandra


	private static final TestCassandra cassandra = new TestCassandraBuilder()
			.scripts(CqlScript.classpath("init.cql"))
			.connectionFactory(new CqlSessionConnectionFactory())
			.cassandraFactory(() -> {
				LocalCassandraFactory factory = new LocalCassandraFactory();
				factory.setVersion("3.11.3");
				return factory.create();
			}).build();
@nosan nosan added the enhancement A general enhancement label Jun 26, 2019
@nosan nosan added this to the 2.0.4 milestone Jun 26, 2019
@nosan nosan self-assigned this Jun 26, 2019
@nosan nosan changed the title Add TestCassandraBuilder to build TestCassandra. Add TestCassandraBuilder to build TestCassandra, CassandraRule and CassandraExtension Jun 26, 2019
@nosan nosan closed this as completed in 86155a2 Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant