package stroom.pipeline.server;

import org.apache.kafka.clients.producer.ProducerRecord;
import org.junit.Test;

public class TestStroomKafkaProducer {

    @Test
    public void testManualSend(){
        StroomKafkaProducer stroomKafkaProducer = new StroomKafkaProducer("172.17.0.4:9092");
        ProducerRecord<String, String> record = new ProducerRecord<>("statistics", "statistics", "some record data");
        stroomKafkaProducer.send(record);
        stroomKafkaProducer.close();
    }
}

@@ -104,64 +104,581 @@
 nit.
-Test;%0A%0Apublic class TestStroomKafkaProducer %7B%0A%0A    @Test
+Ignore;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.runners.MockitoJUnitRunner;%0Aimport stroom.pipeline.server.errorhandler.ErrorReceiverProxy;%0Aimport stroom.util.shared.Severity;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Matchers.eq;%0Aimport static org.mockito.Mockito.verify;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class TestStroomKafkaProducer %7B%0A%0A    @Mock%0A    private ErrorReceiverProxy errorReceiverProxy;%0A%0A    @Test%0A    @Ignore(%22You may use this to test the local instance of Kafka.%22)
 %0A   
@@ -708,16 +708,33 @@
 Send()%7B%0A
+        // Given%0A
         
@@ -936,16 +936,33 @@
  data%22);
+%0A%0A        // When
 %0A       
@@ -997,45 +997,601 @@
 cord
-);%0A        stroomKafkaProducer.close(
+, errorReceiverProxy);%0A%0A        // Then: manually check your Kafka instances 'statistics' topic for 'some record data'%0A    %7D%0A%0A    @Test%0A    public void testBadlyConfigured()%7B%0A        // Given%0A        StroomKafkaProducer stroomKafkaProducer = new StroomKafkaProducer(null);%0A        ProducerRecord%3CString, String%3E record = new ProducerRecord%3C%3E(%22statistics%22, %22statistics%22, %22some record data%22);%0A%0A        // When%0A        stroomKafkaProducer.send(record, errorReceiverProxy);%0A%0A        // Then%0A        verify(errorReceiverProxy).log(eq(Severity.ERROR), eq(null), eq(null), any(String.class), eq(null)
 );%0A 

Add test