Reputation: 1
I have used datastax driver 3.11.5 version to connect to cassadra instance in version 4.x .Is this compatable ? Also when I am using EmbeddedCassandraServiceHelper from cassandra-unit version 4.3.1.0 for junit testing. Getting error :
Test.java:[38,58] error: incompatible types: CqlSession cannot be converted to Session Test.java:[38,66] error: incompatible types: CqlSession cannot be converted to Session
@Before
public void setUp() {
session = EmbeddedCassandraServerHelper.getSession();
dao = new CompressingDataDao<>(session, XY.class);
}
@Test
public void getOne() throws Exception {
String id = "abc";
XY list = createAndSaveEnitty(id);
XY listFromDB = dao.getOne(id);
Assert.assertEquals(list, listFromDB);
}
If driver 3.11.5 is compatable with cassandra version 4, How to do Unit testing as above method is giving error.
Upvotes: 0
Views: 37
Reputation: 106
Cassandra Java Driver 3.11 is compatible with Cassandra 4. But cassandra-unit is using Cassandra Java Driver 4.x. So it seems to me that your dependency is messed up.
Cassandra Java Driver 4.x used modern designs and introduced a lot of breaking changes. Cassandra Java Driver 3.x is not maintained anymore. I would recommend you to upgrade your driver to 4.x.
Upvotes: 1