Skip to content

Commit bb145eb

Browse files
committed
Address minor compiler warnings
1 parent e1d6375 commit bb145eb

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

integration-tests/src/test/java/com/datastax/oss/driver/core/heartbeat/HeartbeatDisabledIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public void should_not_send_heartbeat_when_disabled() throws InterruptedExceptio
4444
SessionUtils.configLoaderBuilder()
4545
.withDuration(DefaultDriverOption.HEARTBEAT_INTERVAL, Duration.ofSeconds(0))
4646
.build();
47-
try (CqlSession session = SessionUtils.newSession(SIMULACRON_RULE, loader)) {
47+
try (CqlSession ignored = SessionUtils.newSession(SIMULACRON_RULE, loader)) {
4848
AtomicInteger heartbeats = registerHeartbeatListener();
4949
SECONDS.sleep(35);
5050

integration-tests/src/test/java/com/datastax/oss/driver/core/heartbeat/HeartbeatIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public void should_send_heartbeat_on_control_connection() {
119119
ProgrammaticDriverConfigLoaderBuilder loader =
120120
SessionUtils.configLoaderBuilder()
121121
.withInt(DefaultDriverOption.CONNECTION_POOL_LOCAL_SIZE, 0);
122-
try (CqlSession session = newSession(loader)) {
122+
try (CqlSession ignored = newSession(loader)) {
123123
AtomicInteger heartbeats = countHeartbeatsOnControlConnection();
124124
await()
125125
.pollInterval(500, TimeUnit.MILLISECONDS)

integration-tests/src/test/java/com/datastax/oss/driver/core/loadbalancing/PerProfileLoadBalancingPolicyIT.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.datastax.oss.driver.api.testinfra.simulacron.SimulacronRule;
3434
import com.datastax.oss.driver.categories.ParallelizableTests;
3535
import com.datastax.oss.simulacron.common.cluster.ClusterSpec;
36+
import java.util.Objects;
3637
import org.junit.Before;
3738
import org.junit.BeforeClass;
3839
import org.junit.ClassRule;
@@ -93,18 +94,20 @@ public static void setup() {
9394
for (Node node : SESSION_RULE.session().getMetadata().getNodes().values()) {
9495
// if node is in dc2 it should be ignored, otherwise (dc1, dc3) it should be local.
9596
NodeDistance expectedDistance =
96-
node.getDatacenter().equals("dc2") ? NodeDistance.IGNORED : NodeDistance.LOCAL;
97+
Objects.equals(node.getDatacenter(), "dc2") ? NodeDistance.IGNORED : NodeDistance.LOCAL;
9798
assertThat(node.getDistance()).isEqualTo(expectedDistance);
9899
}
99100
}
100101

101102
@Test
102103
public void should_use_policy_from_request_profile() {
103104
// Since profile1 uses dc3 as localDC, only those nodes should receive these queries.
104-
Statement statement = QUERY.setExecutionProfileName("profile1");
105+
Statement<?> statement = QUERY.setExecutionProfileName("profile1");
105106
for (int i = 0; i < 10; i++) {
106107
ResultSet result = SESSION_RULE.session().execute(statement);
107-
assertThat(result.getExecutionInfo().getCoordinator().getDatacenter()).isEqualTo("dc3");
108+
Node coordinator = result.getExecutionInfo().getCoordinator();
109+
assertThat(coordinator).isNotNull();
110+
assertThat(coordinator.getDatacenter()).isEqualTo("dc3");
108111
}
109112

110113
assertQueryInDc(0, 0);
@@ -115,10 +118,12 @@ public void should_use_policy_from_request_profile() {
115118
@Test
116119
public void should_use_policy_from_config_when_not_configured_in_request_profile() {
117120
// Since profile2 does not define an lbp config, it should use default which uses dc1.
118-
Statement statement = QUERY.setExecutionProfileName("profile2");
121+
Statement<?> statement = QUERY.setExecutionProfileName("profile2");
119122
for (int i = 0; i < 10; i++) {
120123
ResultSet result = SESSION_RULE.session().execute(statement);
121-
assertThat(result.getExecutionInfo().getCoordinator().getDatacenter()).isEqualTo("dc1");
124+
Node coordinator = result.getExecutionInfo().getCoordinator();
125+
assertThat(coordinator).isNotNull();
126+
assertThat(coordinator.getDatacenter()).isEqualTo("dc1");
122127
}
123128

124129
assertQueryInDc(0, 5);

0 commit comments

Comments
 (0)