Skip to content

Commit f3ee484

Browse files
committed
Replace deprecated AssertJ method
1 parent c72d5b9 commit f3ee484

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

core/src/test/java/com/datastax/dse/driver/internal/core/graph/ContinuousGraphRequestHandlerTest.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import static com.datastax.dse.driver.internal.core.graph.GraphTestUtils.tenGraphRows;
2121
import static com.datastax.oss.driver.Assertions.assertThat;
2222
import static com.datastax.oss.driver.Assertions.assertThatStage;
23+
import static org.assertj.core.api.Assertions.assertThatThrownBy;
2324
import static org.mockito.ArgumentMatchers.anyLong;
2425
import static org.mockito.ArgumentMatchers.eq;
2526
import static org.mockito.Mockito.times;
@@ -182,9 +183,10 @@ public void should_honor_default_timeout() throws Exception {
182183

183184
// will trigger the global timeout and complete it exceptionally
184185
globalTimeout.task().run(globalTimeout);
185-
assertThat(page1Future.toCompletableFuture())
186-
.hasFailedWithThrowableThat()
187-
.isInstanceOf(DriverTimeoutException.class)
186+
assertThat(page1Future.toCompletableFuture()).isCompletedExceptionally();
187+
188+
assertThatThrownBy(() -> page1Future.toCompletableFuture().get())
189+
.hasRootCauseExactlyInstanceOf(DriverTimeoutException.class)
188190
.hasMessageContaining("Query timed out after " + defaultTimeout);
189191
}
190192
}
@@ -233,9 +235,10 @@ public void should_honor_statement_timeout() throws Exception {
233235

234236
// will trigger the global timeout and complete it exceptionally
235237
globalTimeout.task().run(globalTimeout);
236-
assertThat(page1Future.toCompletableFuture())
237-
.hasFailedWithThrowableThat()
238-
.isInstanceOf(DriverTimeoutException.class)
238+
assertThat(page1Future.toCompletableFuture()).isCompletedExceptionally();
239+
240+
assertThatThrownBy(() -> page1Future.toCompletableFuture().get())
241+
.hasRootCauseExactlyInstanceOf(DriverTimeoutException.class)
239242
.hasMessageContaining("Query timed out after " + statementTimeout);
240243
}
241244
}

0 commit comments

Comments
 (0)