import com.thinkbiganalytics.activemq.config.ActiveMqConfig;
import com.thinkbiganalytics.nifi.config.NifiProvenanceConfig;
import com.thinkbiganalytics.nifi.provenance.v2.writer.ProvenanceEventActiveMqWriter;

import org.apache.nifi.provenance.ProvenanceEventRecord;
import org.apache.nifi.provenance.ProvenanceEventType;
import org.apache.nifi.provenance.StandardProvenanceEventRecord;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.jms.JMSException;
import java.util.UUID;

/**
 * Created by sr186054 on 2/24/16.
 */
// Ignore due to dependency on MySQL
@Ignore
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { ActiveMqConfig.class, NifiProvenanceConfig.class, TestConfig.class})
public class TestProvenance {


    @Autowired
    private ProvenanceEventActiveMqWriter activeMqWriter;

    //@Test
    public void sendSimpleMessage() throws InterruptedException, JMSException {

        Thread runner = new Thread(new TestProducer());
        runner.start();
        while (true) {
            //block
        }

    }

    private class TestProducer implements Runnable {

        int counter = 0;

        @Override
        public void run() {
            while (true) {
                counter++;
                ProvenanceEventRecord record = new StandardProvenanceEventRecord.Builder().setEventType(ProvenanceEventType.CONTENT_MODIFIED)
                        .setComponentId(UUID.randomUUID().toString())
                        .setFlowFileUUID(UUID.randomUUID().toString())
                        .setComponentType("PROCESSOR")
                        .setCurrentContentClaim("container", "section", "identifier", 0L, 1000L)
                        .build();


                activeMqWriter.writeEvent(record);
                try {
                    Thread.sleep(2000L);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }


}

@@ -1,28 +1,68 @@
+import com.google.common.collect.Lists;%0A
 import com.thinkbiganalytics
@@ -149,32 +149,195 @@
 ovenanceConfig;%0A
+import com.thinkbiganalytics.nifi.provenance.model.ProvenanceEventRecordDTOHolder;%0Aimport com.thinkbiganalytics.nifi.provenance.v2.ProvenanceEventRecordConverter;%0A
 import com.think
@@ -613,31 +613,8 @@
 re;%0A
-import org.junit.Test;%0A
 impo
@@ -855,49 +855,50 @@
 java
-x.jms.JMSException;%0Aimport java.util.UUID
+.util.UUID;%0A%0Aimport javax.jms.JMSException
 ;%0A%0A/
@@ -2117,16 +2117,221 @@
 ild();%0A%0A
+                ProvenanceEventRecordDTOHolder eventHolder = new ProvenanceEventRecordDTOHolder();%0A                eventHolder.setEvents(Lists.newArrayList(ProvenanceEventRecordConverter.convert(record)));
 %0A       
@@ -2364,23 +2364,29 @@
 iteEvent
-(record
+s(eventHolder
 );%0A     

fix build