|
15 | 15 | */ |
16 | 16 | package com.datastax.driver.core; |
17 | 17 |
|
18 | | -import com.datastax.driver.core.exceptions.NoHostAvailableException; |
19 | 18 | import com.datastax.driver.core.exceptions.UnsupportedFeatureException; |
20 | 19 | import com.datastax.driver.core.utils.CassandraVersion; |
21 | | -import com.google.common.base.Throwables; |
22 | 20 | import com.google.common.collect.ImmutableMap; |
23 | 21 | import org.apache.log4j.Logger; |
24 | | -import org.assertj.core.api.iterable.Extractor; |
25 | 22 | import org.testng.annotations.BeforeMethod; |
26 | 23 | import org.testng.annotations.Test; |
27 | 24 |
|
@@ -246,17 +243,9 @@ public void should_throw_ufe_when_protocol_version_lesser_than_4() throws Except |
246 | 243 | statement.setOutgoingPayload(payload1); |
247 | 244 | v3session.execute(statement); |
248 | 245 | fail("Should not send custom payloads with protocol V3"); |
249 | | - } catch (NoHostAvailableException nhae) { |
250 | | - assertThat(nhae.getErrors().values()) |
251 | | - .extracting(new Extractor<Throwable, Throwable>() { |
252 | | - @Override |
253 | | - public Throwable extract(Throwable input) { |
254 | | - return Throwables.getRootCause(input); |
255 | | - } |
256 | | - }) |
257 | | - .hasOnlyElementsOfType(UnsupportedFeatureException.class) |
258 | | - .extracting("message") |
259 | | - .containsOnly("Unsupported feature with the native protocol V3 (which is currently in use): Custom payloads are only supported since native protocol V4"); |
| 246 | + } catch (UnsupportedFeatureException e) { |
| 247 | + assertThat(e.getMessage()).isEqualTo( |
| 248 | + "Unsupported feature with the native protocol V3 (which is currently in use): Custom payloads are only supported since native protocol V4"); |
260 | 249 | } |
261 | 250 | } |
262 | 251 |
|
|
0 commit comments