1

Our team was in the process of updating our dependencies and one of those is Cassandra Unit. I noticed that the last time this library was updated was in January of 2020 and that there hasn't been any activity in a long time. In addition there are 12 open pull requests that have just been sitting. I did notice some developers have forked this repo to add features they wanted.

We have enjoyed using this library to test CQL in our DAO objects via JUnit and are planning to upgrade to the latest version (4.3.1.0).

I hope that the developer (jsevellec) that was leading this effort is doing well. But in the absence of activity on this repo, and thinking longer term, I was wondering what other libraries might be available that allow ease of testing using an embedded Cassandra instance via JUnit that are more actively supported.

Mike Barlotta
  • 715
  • 4
  • 16

1 Answers1

0

So far I see two ways:

  1. Cooperation with jsevellec if you like that product
  2. Using testcontainers+cassandra
    public class SomeTest {
    
        @Rule
        public CassandraContainer cassandra = new CassandraContainer();
    
    
        @Test
        public void test(){
            Cluster cluster = cassandra.getCluster();
    
            try(Session session = cluster.connect()) {
    
                session.execute("CREATE KEYSPACE IF NOT EXISTS test WITH replication = \n" +
                        "{'class':'SimpleStrategy','replication_factor':'1'};");
    
                List<KeyspaceMetadata> keyspaces = session.getCluster().getMetadata().getKeyspaces();
                List<KeyspaceMetadata> filteredKeyspaces = keyspaces
                        .stream()
                        .filter(km -> km.getName().equals("test"))
                        .collect(Collectors.toList());
    
                assertEquals(1, filteredKeyspaces.size());
            }
        }
    }
    
    There are some questions related to Spring + Testcontainers + Cassandra here https://stackoverflow.com/a/58673372/6916890
lazylead
  • 1,453
  • 1
  • 14
  • 26
  • Regarding (1), the best way to cooperate on an open source project is to submit PRs. Given there are already numerous PRs on that repo, some with unanswered comments I would consider that project "dormant" with no clear path to progressing – Mike Barlotta Apr 27 '22 at 21:38
  • Regarding (2) we just started looking at Test Containers... that looks promising – Mike Barlotta Apr 27 '22 at 21:39
  • @MikeBarlotta regarding (10), try to send an email to him, just pull requests might not be enough... – lazylead Apr 28 '22 at 17:50