justinleet commented on a change in pull request #1554: METRON-2307: Migrate to JUnit5 URL: https://github.com/apache/metron/pull/1554#discussion_r348642524
########## File path: metron-platform/metron-parsing/metron-parsing-storm/src/test/java/org/apache/metron/parsers/topology/ParserTopologyBuilderTest.java ########## @@ -22,55 +22,46 @@ import org.apache.metron.common.configuration.ParserConfigurations; import org.apache.metron.common.configuration.SensorParserConfig; import org.apache.metron.common.configuration.writer.ParserWriterConfiguration; +import org.apache.metron.common.writer.BulkMessageWriter; import org.apache.metron.parsers.bolt.WriterHandler; import org.apache.metron.writer.NoopWriter; import org.apache.metron.writer.kafka.KafkaWriter; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.modules.junit4.PowerMockRunner; +import org.json.simple.JSONObject; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.HashMap; import java.util.Map; import java.util.Optional; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.verifyNoMoreInteractions; -import static org.powermock.api.mockito.PowerMockito.spy; -import static org.powermock.api.mockito.PowerMockito.when; - -@RunWith(PowerMockRunner.class) -@PrepareForTest(ParserTopologyBuilder.class) +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.*; + public class ParserTopologyBuilderTest { - @Mock - private ParserConfigurations configs; + private static ParserConfigurations configs; + private static KafkaWriter kafkaWriter; - @Mock - private KafkaWriter kafkaWriter; + @BeforeAll + public static void setupAll() { + configs = mock(ParserConfigurations.class); + kafkaWriter = mock(KafkaWriter.class); + } - @Before + @BeforeEach public void setup() { - spy(ParserTopologyBuilder.class); - when(ParserTopologyBuilder.createKafkaWriter(Optional.of("brokerUrl"), "zookeeperUrl", Optional.of("securityProtocol"))) - .thenReturn(kafkaWriter); +// spy(ParserTopologyBuilder.class); Review comment: Yep, gone ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services