Skip to content

Commit b88138f

Browse files
Merge branch '5.0.x' into 5.1.x
2 parents 04d2780 + 9e9647b commit b88138f

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/test/java/io/confluent/connect/elasticsearch/ElasticsearchWriterTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ public class ElasticsearchWriterTest extends ElasticsearchSinkTestBase {
5454
private final Schema otherSchema = createOtherSchema();
5555
private final Struct otherRecord = createOtherRecord(otherSchema);
5656

57-
@Rule
58-
public ExpectedException thrown = ExpectedException.none();
59-
6057
private boolean ignoreKey;
6158
private boolean ignoreSchema;
6259

@@ -427,9 +424,10 @@ public void testInvalidRecordException() throws Exception {
427424

428425
final ElasticsearchWriter strictWriter = initWriter(client);
429426

430-
thrown.expect(ConnectException.class);
431-
thrown.expectMessage("Key is used as document id and can not be null");
432-
strictWriter.write(records);
427+
Exception e = assertThrows(ConnectException.class, () -> {
428+
strictWriter.write(records);
429+
});
430+
assertEquals("Key is used as document id and can not be null.", e.getMessage());
433431
}
434432

435433
@Test

0 commit comments

Comments
 (0)