MINOR: Remove deprecated assertThat usage from KafkaLog4jAppenderTest (#6257)

Replace `Assert.assertThat` with `MatcherAssert.assertThat`.

Two commits (08036fa4b1 and c7f99bc2b) were merged at a similar time and
they passed the build in isolation, but not together.

Reviewers: Rajini Sivaram <rajinisivaram@googlemail.com>, Ismael Juma <ismael@juma.me.uk>
This commit is contained in:
Manikumar Reddy 2019-02-12 20:10:01 +05:30 committed by Ismael Juma
parent c7f99bc2bd
commit c0d6fac238
1 changed files with 8 additions and 7 deletions

View File

@ -19,6 +19,7 @@ package org.apache.kafka.log4jappender;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.hamcrest.CoreMatchers.not;
import static org.hamcrest.MatcherAssert.assertThat;
import org.apache.kafka.clients.producer.MockProducer;
import org.apache.kafka.clients.producer.RecordMetadata;
@ -89,7 +90,7 @@ public class KafkaLog4jAppenderTest {
PropertyConfigurator.configure(props);
MockKafkaLog4jAppender mockKafkaLog4jAppender = getMockKafkaLog4jAppender();
Assert.assertThat(
assertThat(
mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_MECHANISM),
equalTo("PLAIN"));
}
@ -106,7 +107,7 @@ public class KafkaLog4jAppenderTest {
PropertyConfigurator.configure(props);
MockKafkaLog4jAppender mockKafkaLog4jAppender = getMockKafkaLog4jAppender();
Assert.assertThat(
assertThat(
mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_JAAS_CONFIG),
equalTo("jaas-config"));
}
@ -119,7 +120,7 @@ public class KafkaLog4jAppenderTest {
private void testProducerPropertyNotSet(String name) {
PropertyConfigurator.configure(getLog4jConfig(false));
MockKafkaLog4jAppender mockKafkaLog4jAppender = getMockKafkaLog4jAppender();
Assert.assertThat(mockKafkaLog4jAppender.getProducerProperties().stringPropertyNames(), not(hasItem(name)));
assertThat(mockKafkaLog4jAppender.getProducerProperties().stringPropertyNames(), not(hasItem(name)));
}
@Test