kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ij...@apache.org
Subject [kafka] branch trunk updated: MINOR: Remove deprecated assertThat usage from KafkaLog4jAppenderTest (#6257)
Date Tue, 12 Feb 2019 14:40:15 GMT
This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new c0d6fac  MINOR: Remove deprecated assertThat usage from KafkaLog4jAppenderTest (#6257)
c0d6fac is described below

commit c0d6fac2385f88feb892666cfa778c1ac0ef8c6b
Author: Manikumar Reddy <manikumar.reddy@gmail.com>
AuthorDate: Tue Feb 12 20:10:01 2019 +0530

    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>
---
 .../kafka/log4jappender/KafkaLog4jAppenderTest.java       | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java
b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java
index 4616c98..7b54efa 100644
--- a/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java
+++ b/log4j-appender/src/test/java/org/apache/kafka/log4jappender/KafkaLog4jAppenderTest.java
@@ -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,9 +90,9 @@ public class KafkaLog4jAppenderTest {
         PropertyConfigurator.configure(props);
 
         MockKafkaLog4jAppender mockKafkaLog4jAppender = getMockKafkaLog4jAppender();
-        Assert.assertThat(
-            mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_MECHANISM),
-            equalTo("PLAIN"));
+        assertThat(
+                mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_MECHANISM),
+                equalTo("PLAIN"));
     }
 
     @Test
@@ -106,9 +107,9 @@ public class KafkaLog4jAppenderTest {
         PropertyConfigurator.configure(props);
 
         MockKafkaLog4jAppender mockKafkaLog4jAppender = getMockKafkaLog4jAppender();
-        Assert.assertThat(
-            mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_JAAS_CONFIG),
-            equalTo("jaas-config"));
+        assertThat(
+                mockKafkaLog4jAppender.getProducerProperties().getProperty(SaslConfigs.SASL_JAAS_CONFIG),
+                equalTo("jaas-config"));
     }
 
     @Test
@@ -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


Mime
View raw message