{"id":15056909,"url":"https://github.com/dananderson/cassandra-test","last_synced_at":"2026-04-01T21:49:44.155Z","repository":{"id":57741049,"uuid":"59169283","full_name":"dananderson/cassandra-test","owner":"dananderson","description":"Cassandra Test is a Java test framework for writing unit tests and integration tests against a Cassandra database.","archived":false,"fork":false,"pushed_at":"2016-06-18T01:13:16.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T13:42:14.703Z","etag":null,"topics":["cassandra","cassandra-database","cassandra-test","java","spring-test","unit-testing"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dananderson.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-19T03:02:08.000Z","updated_at":"2017-10-01T04:42:51.000Z","dependencies_parsed_at":"2022-09-06T23:31:08.631Z","dependency_job_id":null,"html_url":"https://github.com/dananderson/cassandra-test","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/dananderson/cassandra-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dananderson%2Fcassandra-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dananderson%2Fcassandra-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dananderson%2Fcassandra-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dananderson%2Fcassandra-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dananderson","download_url":"https://codeload.github.com/dananderson/cassandra-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dananderson%2Fcassandra-test/sbom","scorecard":{"id":318424,"data":{"date":"2025-08-11","repo":{"name":"github.com/dananderson/cassandra-test","commit":"52278a560acf2befed762fda3a0443684f67d097"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-5mg8-w23w-74h3","Warn: Project is vulnerable to: GHSA-7g45-4rm6-3mm3","Warn: Project is vulnerable to: GHSA-mvr2-9pj6-7w5j","Warn: Project is vulnerable to: GHSA-9vjp-v76f-g363","Warn: Project is vulnerable to: GHSA-grg4-wf29-r9vv","Warn: Project is vulnerable to: GHSA-389x-839f-4rhx","Warn: Project is vulnerable to: GHSA-xq3w-v528-46rv","Warn: Project is vulnerable to: GHSA-6mjq-h674-j845","Warn: Project is vulnerable to: GHSA-p2v9-g2qv-p635","Warn: Project is vulnerable to: GHSA-rv63-gqm8-9w8q","Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T00:49:26.215Z","repository_id":57741049,"created_at":"2025-08-18T00:49:26.216Z","updated_at":"2025-08-18T00:49:26.216Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31046837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T09:35:52.079Z","status":"ssl_error","status_checked_at":"2026-03-27T09:35:20.916Z","response_time":164,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cassandra","cassandra-database","cassandra-test","java","spring-test","unit-testing"],"created_at":"2024-09-24T21:58:05.584Z","updated_at":"2026-04-01T21:49:43.986Z","avatar_url":"https://github.com/dananderson.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cassandra Test\n[![Build Status](https://travis-ci.org/dananderson/cassandra-test.svg?branch=master)](https://travis-ci.org/dananderson/cassandra-test.svg?branch=master)\n[![codecov.io](https://codecov.io/github/dananderson/cassandra-test/coverage.svg?branch=master)](https://codecov.io/github/dananderson/cassandra-test?branch=master)\n\nCassandra Test is a Java test framework for writing unit tests and integration tests against a Cassandra database.\n\n## Features\n\n- Connection management\n- Keyspace and schema management\n- Data loading from CQL files\n- Rollbacks\n- TestNG, JUnit 4 and Spring Test support\n- Backwards compatible with Java 6+, Cassandra 2.x \u0026 3.x and Java Driver 2.x \u0026 3.x\n- Highly configurable\n\n\n## Getting Cassandra Test\n\nCassandra Test publishes an artifact for each supported test framework.\n\n| Test Framework | Cassandra Test Artifact |\n| --- | --- |\n| TestNG | [org.unittested:cassandra-test-testng:1.0.3](http://search.maven.org/#artifactdetails%7Corg.unittested%7Ccassandra-test-testng%7C1.0.3%7Cjar) |\n| JUnit 4 | [org.unittested:cassandra-test-junit:1.0.3](http://search.maven.org/#artifactdetails%7Corg.unittested%7Ccassandra-test-junit%7C1.0.3%7Cjar) |\n| Spring Test | [org.unittested:cassandra-test-spring:1.0.3](http://search.maven.org/#artifactdetails%7Corg.unittested%7Ccassandra-test-spring%7C1.0.3%7Cjar) |\n\nIf your environment requires a custom integration, use the Cassandra Test Core artifact: [org.unittested:cassandra-test-core:1.0.3](http://search.maven.org/#artifactdetails%7Corg.unittested%7Ccassandra-test-core%7C1.0.3%7Cjar). The **TestEnvironmentAdapter** can be used to connect test life cycle events to Cassandra Test.\n\n## Writing Tests\n\n### Using Test Framework Bindings\n\nEach test framework has a slightly different way to bind with Cassandra Test. Once bound, any test in any test framework can use Cassandra Test annotations to configure Cassandra behavior.\n\n#### TestNG\n\nIn the TestNG environment, tests can extend **AbstractTestNGCassandraTest** to be a Cassandra Test. **Session** and **Cluster** connection objects are available through this base class.\n\n```java\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n#### JUnit 4\n\nIn the JUnit 4 environment, multiple binding options are available.\n\nFirst, tests can extend **AbstractJUnit4CassandraTest** to be a Cassandra Test. **Session** and **Cluster** connection objects are available through this base class.\n\n\n```java\npublic class MyTest extends AbstractJUnit4CassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\nSecond, tests can use **CassandraClassRule** and **CassandraRule** to be a Cassandra Test. **Session** and **Cluster** connection objects are available through the **CassandraRule** instance.\n\n```java\npublic class MyTest {\n    @ClassRule\n    public static CassandraClassRule classRule = new CassandraClassRule();\n\n    @Rule\n    public CassandraRule cassandraRule = new CassandraRule(classRule);\n\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n#### Spring Test\n\nIn the Spring Test environment, tests add **SpringCassandraTestExecutionListener** to be a Cassandra Test. **Session** and **Cluster** connection objects are available through the Autowire-like annotation @CassandraBean.\n\n```java\n@TestExecutionListeners(value = SpringCassandraTestExecutionListener.class, mergeMode = MERGE_WITH_DEFAULTS)\npublic class MyTest extends AbstractTestNGSpringContextTests {\n\n    @CassandraBean\n    private Session session;\n\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\n### Configuration\n\nCassandra Tests can be configured through Java annotations.\n\n#### Connection\n\nWhen a test is bound to Cassandra Test, the test will automatically try to connect to a Cassandra cluster\nat 127.0.0.1:9042 with no authentication. If the connection requires a different configuration, @CassandraConnect\ncan be used.\n\n```java\n@Connect(host = \"127.0.0.2\", user = \"cassandra\", password = \"cassandra\")\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n#### Keyspace and Schema\n\nThe primary use case for Cassandra Test is to run tests against a single keyspace. Cassandra Test manages this\nkeyspace by installing schema, detecting schema modifications and rebuilding schema as necessary to maintain\nconsistent state across tests.\n\nThe @CassandraKeyspace annotation gives Cassandra Test full control of a keyspace. The annotation describes\nhow to create the keyspace and how to create it's schema. If Cassandra Test detects that a keyspace has been\naltered from this state, Cassandra Test will drop and re-create the keyspace before the next test run.\n\n```java\n@CassandraKeyspace(value = \"my_keyspace\", schema = \"classpath:my_keyspace_schema.cql\")\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\nThe @CassandraImportKeyspace annotation declares a schema and keyspace that has been configured outside of\nthe control of Cassandra Test. Cassandra Test cannot re-create or drop this keyspace. If a test modifies the\nkeyspace schema in any way, the test automatically fails.\n\n```java\n@CassandraImportKeyspace(\"my_keyspace\")\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\n#### Data Loading\n\nTable data can be loaded using the @CassandraData annotation. Currently, data loading supports CQL files containing\nCQL statements delimited by \";\". The format is exactly the same as CQL files executable by cqlsh.\n\n```java\n@CassandraKeyspace(value = \"my_keyspace\", schema = \"classpath:my_keyspace_schema.cql\")\n@CassandraData(\"classpath:my_keyspace_table_data.cql\")\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\n#### Rollback\n\nWhen a test completes, Cassandra Test will perform a pseudo-rollback or clean up of the keyspace. The clean up\ncan be truncation of keyspace tables or dropping the keyspace. The rollback behavior is configured through the\n@CassandraRollback annotation.\n\n```java\n@CassandraKeyspace(value = \"my_keyspace\", schema = \"classpath:my_keyspace_schema.cql\")\n@CassandraData(\"classpath:my_keyspace_table_data.cql\")\n@CassandraRollback(afterClass=RollbackStrategy.DROP)\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\n#### Properties\n\nFor larger projects, hard coding keyspace names and hosts in annotations may not be clean or practical. Cassandra Test\nsupports property references in annotations to address the problem. Properties are sourced from a Java properties file. By\ndefault, /cassandra-test.properties from the class path is used. Otherwise, a properties file can be specified with the @CassandraProperties\nannotation.\n\n```java\n@CassandraImportKeyspace(\"${cassandra.test.keyspace}\")\npublic class MyTest extends AbstractTestNGCassandraTest {\n    @Test\n    public cassandraTest() {\n        ...\n    }\n}\n```\n\n## Compatibility\nCassandra Test has been built and tested with:\n\n| Technology            | Supported Versions              |\n| --------------------- | ----------------------------    |\n| Datastax Java Driver  | 2.0.2+, 2.1.0+, 3.0.0+          |\n| Apache Cassandra      | 2.0.4+, 2.1.0+, 2.2.0+, 3.0.0+  |\n| Java                  | 6+                              |\n\n## License\n[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\n## Contributing\nPull requests for bug fixes and new features are welcome.\n\nThe following items are being considered for future releases of Cassandra Test.\n- Improve README documentation across the project.\n- Wiki documentation.\n- Create an example usage project.\n- Add method level annotations.\n- Investigate other data loading source file formats, including JSON, YAML, XML and CSV.\n- Investigate \"golden\" data for table data state verification.\n- Add plugins for schema management tools.\n- Investigate support for managing Cassandra instances with CCM, Embedded Cassandra and SCassandra.\n- Investigate negative testing tools to put Cassandra into bad states (node down, etc).\n- Performance: session cache, file read cache, etc.\n- Parallel test support (why?).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdananderson%2Fcassandra-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdananderson%2Fcassandra-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdananderson%2Fcassandra-test/lists"}