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

Refactor integration tests to support multiple C* distributions #1958

Open
wants to merge 6 commits into
base: 4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def initializeEnvironment() {
. ${JABBA_SHELL}
jabba which 1.8''', returnStdout: true).trim()

sh label: 'Download Apache CassandraⓇ or DataStax Enterprise',script: '''#!/bin/bash -le
sh label: 'Download Apache CassandraⓇ, DataStax Enterprise or DataStax HCD ',script: '''#!/bin/bash -le
. ${JABBA_SHELL}
jabba use 1.8
. ${CCM_ENVIRONMENT_SHELL} ${SERVER_VERSION}
Expand All @@ -75,13 +75,26 @@ CCM_CASSANDRA_VERSION=${DSE_FIXED_VERSION} # maintain for backwards compatibilit
CCM_VERSION=${DSE_FIXED_VERSION}
CCM_SERVER_TYPE=dse
DSE_VERSION=${DSE_FIXED_VERSION}
CCM_IS_DSE=true
CCM_BRANCH=${DSE_FIXED_VERSION}
DSE_BRANCH=${DSE_FIXED_VERSION}
ENVIRONMENT_EOF
'''
}

if (env.SERVER_VERSION.split('-')[0] == 'hcd') {
env.HCD_FIXED_VERSION = env.SERVER_VERSION.split('-')[1]
sh label: 'Update environment for DataStax HCD', script: '''#!/bin/bash -le
cat >> ${HOME}/environment.txt << ENVIRONMENT_EOF
CCM_CASSANDRA_VERSION=${HCD_FIXED_VERSION} # maintain for backwards compatibility
CCM_VERSION=${HCD_FIXED_VERSION}
CCM_SERVER_TYPE=hcd
HCD_VERSION=${HCD_FIXED_VERSION}
CCM_BRANCH=${HCD_FIXED_VERSION}
HCD_BRANCH=${HCD_FIXED_VERSION}
ENVIRONMENT_EOF
'''
}

sh label: 'Display Java and environment information',script: '''#!/bin/bash -le
# Load CCM environment variables
set -o allexport
Expand Down Expand Up @@ -144,7 +157,7 @@ def executeTests() {
-Dmaven.test.failure.ignore=true \
-Dmaven.javadoc.skip=${SKIP_JAVADOCS} \
-Dccm.version=${CCM_CASSANDRA_VERSION} \
-Dccm.dse=${CCM_IS_DSE} \
-Dccm.${CCM_SERVER_TYPE:cassandra}=true \
-Dproxy.path=${HOME}/proxy \
${SERIAL_ITS_ARGUMENT} \
${ISOLATED_ITS_ARGUMENT} \
Expand Down Expand Up @@ -269,6 +282,7 @@ pipeline {
'dse-6.7.17', // Previous DataStax Enterprise
'dse-6.8.30', // Current DataStax Enterprise
'dse-6.9.0', // Current DataStax Enterprise
'hcd-1.0.0', // Current DataStax HCD
'ALL'],
description: '''Apache Cassandra&reg; and DataStax Enterprise server version to use for adhoc <b>BUILD-AND-EXECUTE-TESTS</b> builds
<table style="width:100%">
Expand Down Expand Up @@ -330,6 +344,10 @@ pipeline {
<td><strong>dse-6.9.0</strong></td>
<td>DataStax Enterprise v6.9.x</td>
</tr>
<tr>
<td><strong>hcd-1.0.0</strong></td>
<td>DataStax HCD v1.0.x</td>
</tr>
</table>''')
choice(
name: 'ADHOC_BUILD_AND_EXECUTE_TESTS_JABBA_VERSION',
Expand Down Expand Up @@ -421,9 +439,9 @@ pipeline {
H 2 * * 0 %CI_SCHEDULE=WEEKENDS;CI_SCHEDULE_SERVER_VERSIONS=2.1 3.0 4.0 dse-4.8.16 dse-5.0.15 dse-5.1.35 dse-6.0.18 dse-6.7.17;CI_SCHEDULE_JABBA_VERSION=1.8
# Every weeknight (Monday - Friday) around 12:00 PM noon
### JDK11 tests against 3.11, 4.1, 5.0-beta1 and DSE 6.8
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30 dse-6.9.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30 dse-6.9.0 hcd-1.0.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.11
### JDK17 tests against 3.11, 4.1, 5.0-beta1 and DSE 6.8
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30 dse-6.9.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.17
H 12 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS;CI_SCHEDULE_SERVER_VERSIONS=3.11 4.1 5.0-beta1 dse-6.8.30 dse-6.9.0 hcd-1.0.0;CI_SCHEDULE_JABBA_VERSION=openjdk@1.17
""" : "")
}

Expand Down Expand Up @@ -460,7 +478,8 @@ pipeline {
values '3.11', // Latest stable Apache CassandraⓇ
'4.1', // Development Apache CassandraⓇ
'dse-6.8.30', // Current DataStax Enterprise
'dse-6.9.0' // Current DataStax Enterprise
'dse-6.9.0', // Current DataStax Enterprise
'hcd-1.0.0' // Current DataStax HCD
}
axis {
name 'JABBA_VERSION'
Expand Down Expand Up @@ -578,7 +597,8 @@ pipeline {
'dse-6.0.18', // Previous DataStax Enterprise
'dse-6.7.17', // Previous DataStax Enterprise
'dse-6.8.30', // Current DataStax Enterprise
'dse-6.9.0' // Current DataStax Enterprise
'dse-6.9.0', // Current DataStax Enterprise
'hcd-1.0.0' // Current DataStax HCD
}
}
when {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public class Version implements Comparable<Version>, Serializable {

private static final Pattern pattern = Pattern.compile(VERSION_REGEXP);

@NonNull public static final Version V1_0_0 = Objects.requireNonNull(parse("1.0.0"));
@NonNull public static final Version V2_1_0 = Objects.requireNonNull(parse("2.1.0"));
@NonNull public static final Version V2_2_0 = Objects.requireNonNull(parse("2.2.0"));
@NonNull public static final Version V3_0_0 = Objects.requireNonNull(parse("3.0.0"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,8 @@ public void prepared_statement_paging_should_be_resilient_to_schema_change() {
// dropped.
Row row = it.next();
assertThat(row.getString("k")).isNotNull();
if (ccmRule
.getDseVersion()
.orElseThrow(IllegalStateException::new)
.compareTo(Objects.requireNonNull(Version.parse("6.0.0")))
assertThat(ccmRule.isDistributionOf(BackendType.DSE)).isTrue();
if (ccmRule.getDistributionVersion().compareTo(Objects.requireNonNull(Version.parse("6.0.0")))
>= 0) {
// DSE 6 only, v should be null here since dropped.
// Not reliable for 5.1 since we may have gotten page queued before schema changed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.Version;
import com.datastax.oss.driver.api.core.servererrors.InvalidQueryException;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendRequirement;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
Expand Down Expand Up @@ -643,9 +644,9 @@ public void should_allow_use_of_dsl_graph_binary() {
*/
@Test
public void should_return_correct_results_when_bulked() {
Optional<Version> dseVersion = ccmRule().getCcmBridge().getDseVersion();
Assumptions.assumeThat(
dseVersion.isPresent() && dseVersion.get().compareTo(Version.parse("5.1.2")) > 0)
CcmBridge.isDistributionOf(BackendType.DSE)
&& CcmBridge.getDistributionVersion().compareTo(Version.parse("5.1.2")) > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like we're just moving the problem around a bit. We haven't decreased the verbosity... we've just moved it around a bit.

There are a lot of instances of things that use this pattern:

Are we DSE/OSS/HCD && are we greater than/less than/something else some specific version

The removal of the Optional types here (i.e. the removal of CcmBridge.getDseVersion() below) means that we have to remember to do both of the checks above manually. If we were to make better use of the Optional type, however, we could do the whole thing in a single check. For example, the statements above can also be expressed as:

Assumptions.assumeThat(
    ccmRule().getCcmBridge().getDseVersion().map(v -> v.compareTo(Version.parse("5.1.2")) > 0).orElse(false))
    .isTrue();

In this case if getDseVersion() returns an empty Optional (because we aren't dealing with DSE) the orElse() will return false. Otherwise we do the integer compare and return true or false based on it's results. This approach allows us to encapsulate all the checks we want into a single line of logic. I'd argue that's more desirable in a test framework like this where you want to make sure your base assumptions are respected before moving on to the actual tests.

.isTrue();

List<String> results = graphTraversalSource().E().label().barrier().toList();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ public void should_allow_use_of_dsl_graph_binary() throws Exception {
@Test
public void should_return_correct_results_when_bulked() {
Assumptions.assumeThat(
ccmRule().getCcmBridge().getDseVersion().get().compareTo(Version.parse("5.1.2")) > 0)
ccmRule().getCcmBridge().getDistributionVersion().compareTo(Version.parse("5.1.2")) > 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a change in logic. Before we were getting the DSE version specifically and comparing it to the min version we want to support for this test. Here we're getting a "distribution version" (which could be anything) and checking to see if it exceeds the min version. We should somehow be validating that we're dealing with a DSE version when we get it.

Note that GraphTraversalRemoteITBase above does exactly the same check... but it makes sure we're dealing with a DSE distribution before we continue on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for catching this. I do not know how I overlooked it. Fixed.

.isTrue();

GraphResultSet rs =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ public void should_parse_aggregate_with_deterministic() {
}

private static boolean isDse6OrHigher() {
assumeThat(CCM_RULE.getDseVersion())
assumeThat(CCM_RULE.isDistributionOf(BackendType.DSE))
.describedAs("DSE required for DseFunctionMetadata tests")
.isPresent();
return CCM_RULE.getDseVersion().get().compareTo(DSE_6_0_0) >= 0;
.isTrue();
return CCM_RULE.getDistributionVersion().compareTo(DSE_6_0_0) >= 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,9 @@ public void should_parse_function_with_deterministic_and_monotonic_on() {
}

private static boolean isDse6OrHigher() {
assumeThat(CCM_RULE.getDseVersion())
assumeThat(CCM_RULE.isDistributionOf(BackendType.DSE))
.describedAs("DSE required for DseFunctionMetadata tests")
.isPresent();
return CCM_RULE.getDseVersion().get().compareTo(DSE_6_0_0) >= 0;
.isTrue();
return CCM_RULE.getDistributionVersion().compareTo(DSE_6_0_0) >= 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.datastax.oss.driver.categories.ParallelizableTests;
Expand Down Expand Up @@ -75,8 +76,9 @@ public static void setup() {
public void should_execute_queries_with_snappy_compression() throws Exception {
Assume.assumeTrue(
"Snappy is not supported in OSS C* 4.0+ with protocol v5",
CCM_RULE.getDseVersion().isPresent()
|| CCM_RULE.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) < 0);
!CCM_RULE.isDistributionOf(BackendType.HCD)
&& (CCM_RULE.isDistributionOf(BackendType.DSE)
|| CCM_RULE.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) < 0));
createAndCheckCluster("snappy");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.datastax.oss.driver.api.core.cql.Row;
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.datastax.oss.driver.categories.IsolatedTests;
Expand Down Expand Up @@ -79,7 +80,7 @@ public static void setup() {
public void should_execute_queries_with_snappy_compression() throws Exception {
Assume.assumeTrue(
"Snappy is not supported in OSS C* 4.0+ with protocol v5",
CCM_RULE.getDseVersion().isPresent()
CCM_RULE.isDistributionOf(BackendType.DSE)
|| CCM_RULE.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) < 0);
createAndCheckCluster("snappy");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.datastax.oss.driver.api.core.cql.SimpleStatement;
import com.datastax.oss.driver.api.core.metadata.EndPoint;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.categories.ParallelizableTests;
import java.net.InetAddress;
Expand Down Expand Up @@ -82,7 +83,7 @@ public void should_fetch_trace_when_tracing_enabled() {
InetAddress nodeAddress = ((InetSocketAddress) contactPoint.resolve()).getAddress();
boolean expectPorts =
CCM_RULE.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) >= 0
&& !CCM_RULE.getDseVersion().isPresent();
&& !CCM_RULE.isDistributionOf(BackendType.DSE);

QueryTrace queryTrace = executionInfo.getQueryTrace();
assertThat(queryTrace.getTracingId()).isEqualTo(executionInfo.getTracingId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.datastax.oss.driver.api.core.metadata.schema.TableMetadata;
import com.datastax.oss.driver.api.testinfra.ccm.CcmRule;
import com.datastax.oss.driver.api.testinfra.ccm.SchemaChangeSynchronizer;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.datastax.oss.driver.categories.ParallelizableTests;
Expand All @@ -37,12 +38,14 @@
import com.datastax.oss.driver.internal.core.metadata.schema.DefaultTableMetadata;
import com.datastax.oss.driver.shaded.guava.common.base.Charsets;
import com.datastax.oss.driver.shaded.guava.common.base.Splitter;
import com.datastax.oss.driver.shaded.guava.common.collect.ImmutableMap;
import com.google.common.io.Files;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.time.Duration;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.regex.Pattern;
import org.junit.BeforeClass;
Expand Down Expand Up @@ -79,17 +82,23 @@ public class DescribeIT {
Splitter.on(Pattern.compile(";\n")).omitEmptyStrings();

private static Version serverVersion;
private static boolean isDse;

private static final Map<BackendType, String> scriptFileForBackend =
ImmutableMap.<BackendType, String>builder()
.put(BackendType.CASSANDRA, "DescribeIT/oss")
.put(BackendType.DSE, "DescribeIT/dse")
.put(BackendType.HCD, "DescribeIT/hcd")
.build();

private static File scriptFile;
private static String scriptContents;

@BeforeClass
public static void setup() {
Optional<Version> dseVersion = CCM_RULE.getDseVersion();
isDse = dseVersion.isPresent();
serverVersion =
isDse ? dseVersion.get().nextStable() : CCM_RULE.getCassandraVersion().nextStable();
CCM_RULE.isDistributionOf(BackendType.CASSANDRA)
? CCM_RULE.getCassandraVersion().nextStable()
: CCM_RULE.getDistributionVersion().nextStable();

scriptFile = getScriptFile();
assertThat(scriptFile).exists();
Expand All @@ -114,12 +123,12 @@ public void describe_output_should_match_creation_script() throws Exception {
"Describe output doesn't match create statements, "
+ "maybe you need to add a new script in integration-tests/src/test/resources. "
+ "Server version = %s %s, used script = %s",
isDse ? "DSE" : "Cassandra", serverVersion, scriptFile)
CCM_RULE.getDistribution(), serverVersion, scriptFile)
.isEqualTo(scriptContents);
}

private boolean atLeastVersion(Version dseVersion, Version ossVersion) {
Version comparison = isDse ? dseVersion : ossVersion;
Version comparison = CCM_RULE.isDistributionOf(BackendType.DSE) ? dseVersion : ossVersion;
return serverVersion.compareTo(comparison) >= 0;
}

Expand All @@ -138,11 +147,9 @@ public void keyspace_metadata_should_be_serializable() throws Exception {
assertThat(ks.getUserDefinedTypes()).isNotEmpty();
assertThat(ks.getTables()).isNotEmpty();
if (atLeastVersion(Version.V5_0_0, Version.V3_0_0)) {

assertThat(ks.getViews()).isNotEmpty();
}
if (atLeastVersion(Version.V5_0_0, Version.V2_2_0)) {

assertThat(ks.getFunctions()).isNotEmpty();
assertThat(ks.getAggregates()).isNotEmpty();
}
Expand Down Expand Up @@ -177,7 +184,7 @@ private static File getScriptFile() {
logbackTestUrl);
}
File resourcesDir = new File(logbackTestUrl.getFile()).getParentFile();
File scriptsDir = new File(resourcesDir, isDse ? "DescribeIT/dse" : "DescribeIT/oss");
File scriptsDir = new File(resourcesDir, scriptFileForBackend.get(CCM_RULE.getDistribution()));
LOG.debug("Looking for a matching script in directory {}", scriptsDir);

File[] candidates = scriptsDir.listFiles();
Expand All @@ -204,8 +211,7 @@ private static File getScriptFile() {
.as("Could not find create script with version <= %s in %s", serverVersion, scriptsDir)
.isNotNull();

LOG.info(
"Using {} to test against {} {}", bestFile, isDse ? "DSE" : "Cassandra", serverVersion);
LOG.info("Using {} to test against {} {}", bestFile, CCM_RULE.getDistribution(), serverVersion);
return bestFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ public void should_expose_node_metadata() {
assertThat(node.getListenAddress().get().getAddress()).isEqualTo(connectAddress.getAddress());
assertThat(node.getDatacenter()).isEqualTo("dc1");
assertThat(node.getRack()).isEqualTo("r1");
if (!CcmBridge.DSE_ENABLEMENT) {
// CcmBridge does not report accurate C* versions for DSE, only approximated values
if (CcmBridge.isDistributionOf(BackendType.CASSANDRA)) {
// CcmBridge does not report accurate C* versions for other distributions (e.g. DSE), only
// approximated values
assertThat(node.getCassandraVersion()).isEqualTo(ccmRule.getCassandraVersion());
}
assertThat(node.getState()).isSameAs(NodeState.UP);
Expand Down Expand Up @@ -106,7 +107,7 @@ public void should_expose_dse_node_properties() {
DseNodeProperties.DSE_WORKLOADS,
DseNodeProperties.SERVER_ID);
assertThat(node.getExtras().get(DseNodeProperties.DSE_VERSION))
.isEqualTo(ccmRule.getDseVersion().get());
.isEqualTo(ccmRule.getDistributionVersion());
assertThat(node.getExtras().get(DseNodeProperties.SERVER_ID)).isInstanceOf(String.class);
assertThat(node.getExtras().get(DseNodeProperties.DSE_WORKLOADS)).isInstanceOf(Set.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.datastax.oss.driver.api.core.type.DataTypes;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import com.datastax.oss.driver.api.testinfra.session.SessionUtils;
import com.google.common.collect.ImmutableList;
Expand All @@ -54,8 +55,8 @@ public class SchemaChangesIT {

static {
CustomCcmRule.Builder builder = CustomCcmRule.builder();
if (!CcmBridge.DSE_ENABLEMENT
&& CcmBridge.VERSION.nextStable().compareTo(Version.V4_0_0) >= 0) {
if (!CcmBridge.isDistributionOf(BackendType.DSE)
&& CcmBridge.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) >= 0) {
builder.withCassandraConfiguration("enable_materialized_views", true);
}
CCM_RULE = builder.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,8 @@ public void should_exclude_virtual_keyspaces_from_token_map() {

private void skipIfDse60() {
// Special case: DSE 6.0 reports C* 4.0 but does not support virtual tables
if (ccmRule.getDseVersion().isPresent()) {
Version dseVersion = ccmRule.getDseVersion().get();
if (dseVersion.compareTo(DSE_MIN_VIRTUAL_TABLES) < 0) {
if (ccmRule.isDistributionOf(BackendType.DSE)) {
if (ccmRule.getDistributionVersion().compareTo(DSE_MIN_VIRTUAL_TABLES) < 0) {
throw new AssumptionViolatedException("DSE 6.0 does not support virtual tables");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import com.datastax.oss.driver.api.mapper.entity.saving.NullSavingStrategy;
import com.datastax.oss.driver.api.testinfra.ccm.CcmBridge;
import com.datastax.oss.driver.api.testinfra.ccm.CustomCcmRule;
import com.datastax.oss.driver.api.testinfra.requirement.BackendType;
import com.datastax.oss.driver.api.testinfra.session.SessionRule;
import io.reactivex.Flowable;
import java.util.UUID;
Expand All @@ -57,8 +58,8 @@ public class DeleteReactiveIT extends InventoryITBase {
@ClassRule public static TestRule chain = RuleChain.outerRule(ccmRule).around(sessionRule);

private static CustomCcmRule.Builder configureCcm(CustomCcmRule.Builder builder) {
if (!CcmBridge.DSE_ENABLEMENT
&& CcmBridge.VERSION.nextStable().compareTo(Version.V4_0_0) >= 0) {
if (!CcmBridge.isDistributionOf(BackendType.DSE)
&& CcmBridge.getCassandraVersion().nextStable().compareTo(Version.V4_0_0) >= 0) {
builder.withCassandraConfiguration("enable_sasi_indexes", true);
}
return builder;
Expand Down
Loading