org.apache.nifi.util.TestRunner.enqueue() - java examples

Here are the examples of the java api org.apache.nifi.util.TestRunner.enqueue() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

13 View Complete Implementation : TestPutSplunk.java
Copyright Apache License 2.0
Author : apache
@Test
public void testCompletingPreviousBatchOnNextExecution() {
    runner.setProperty(PutSplunk.PROTOCOL, PutSplunk.UDP_VALUE.getValue());
    final String message = "This is one message, should send the whole FlowFile";
    runner.enqueue(message);
    // don't shutdown to prove that next onTrigger complete previous batch
    runner.run(2, false);
    runner.replacedertAllFlowFilesTransferred(PutSplunk.REL_SUCCESS, 1);
    final MockFlowFile mockFlowFile = runner.getFlowFilesForRelationship(PutSplunk.REL_SUCCESS).get(0);
    mockFlowFile.replacedertContentEquals(message);
    replacedert.replacedertEquals(1, sender.getMessages().size());
    replacedert.replacedertEquals(message, sender.getMessages().get(0));
}

13 View Complete Implementation : TestPutSolrContentStream.java
Copyright Apache License 2.0
Author : apache
@Test
public void testIOExceptionShouldRouteToConnectionFailure() throws IOException, SolrServerException {
    final Throwable throwable = new IOException("Error communicating with Solr");
    final ExceptionThrowingProcessor proc = new ExceptionThrowingProcessor(throwable);
    final TestRunner runner = createDefaultTestRunner(proc);
    try (FileInputStream fileIn = new FileInputStream(CUSTOM_JSON_SINGLE_DOC_FILE)) {
        runner.enqueue(fileIn);
        runner.run();
        runner.replacedertAllFlowFilesTransferred(PutSolrContentStream.REL_CONNECTION_FAILURE, 1);
        verify(proc.getSolrClient(), times(1)).request(any(SolrRequest.clreplaced), eq((String) null));
    }
}

13 View Complete Implementation : TestPublishKafkaRecord_2_0.java
Copyright Apache License 2.0
Author : apache
@Test
public void testMultipleSuccess() throws IOException {
    final Set<FlowFile> flowFiles = new HashSet<>();
    flowFiles.add(runner.enqueue("John Doe, 48"));
    flowFiles.add(runner.enqueue("John Doe, 48"));
    flowFiles.add(runner.enqueue("John Doe, 48"));
    when(mockLease.complete()).thenReturn(createAllSuccessPublishResult(flowFiles, 1));
    runner.run();
    runner.replacedertAllFlowFilesTransferred(PublishKafkaRecord_2_0.REL_SUCCESS, 3);
    verify(mockLease, times(3)).publish(any(FlowFile.clreplaced), any(RecordSet.clreplaced), any(RecordSetWriterFactory.clreplaced), AdditionalMatchers.or(any(RecordSchema.clreplaced), isNull()), eq(null), eq(TOPIC_NAME), nullable(Function.clreplaced));
    verify(mockLease, times(1)).complete();
    verify(mockLease, times(0)).poison();
    verify(mockLease, times(1)).close();
}

13 View Complete Implementation : TestExtractText.java
Copyright Apache License 2.0
Author : apache
@Test
public void testShouldAllowNoCaptureGroups() throws Exception {
    // Arrange
    final TestRunner testRunner = TestRunners.newTestRunner(new ExtractText());
    final String attributeKey = "regex.result";
    testRunner.setProperty(attributeKey, "(?s).*");
    // Act
    testRunner.enqueue(SAMPLE_STRING.getBytes("UTF-8"));
    testRunner.run();
    // replacedert
    testRunner.replacedertAllFlowFilesTransferred(ExtractText.REL_MATCH, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(ExtractText.REL_MATCH).get(0);
    // There is no global capture group, so only "key.0" exists
    out.replacedertAttributeNotExists(attributeKey);
    out.replacedertAttributeEquals(attributeKey + ".0", SAMPLE_STRING);
}

13 View Complete Implementation : TestExtractEmailAttachments.java
Copyright Apache License 2.0
Author : apache
@Test
public void testValidEmailWithoutAttachments() throws Exception {
    final TestRunner runner = TestRunners.newTestRunner(new ExtractEmailAttachments());
    // Create the message dynamically
    byte[] simpleEmail = attachmentGenerator.SimpleEmail();
    runner.enqueue(simpleEmail);
    runner.run();
    runner.replacedertTransferCount(ExtractEmailAttachments.REL_ORIGINAL, 1);
    runner.replacedertTransferCount(ExtractEmailAttachments.REL_FAILURE, 0);
    runner.replacedertTransferCount(ExtractEmailAttachments.REL_ATTACHMENTS, 0);
}

13 View Complete Implementation : TestExtractText.java
Copyright Apache License 2.0
Author : apache
@Test
public void testProcessor() throws Exception {
    final TestRunner testRunner = TestRunners.newTestRunner(new ExtractText());
    testRunner.setProperty("regex.result1", "(?s)(.*)");
    testRunner.setProperty("regex.result2", "(?s).*(bar1).*");
    // reluctant gets first
    testRunner.setProperty("regex.result3", "(?s).*?(bar\\d).*");
    // reluctant w/ repeated pattern gets second
    testRunner.setProperty("regex.result4", "(?s).*?(?:bar\\d).*?(bar\\d).*?(bar3).*");
    // greedy gets last
    testRunner.setProperty("regex.result5", "(?s).*(bar\\d).*");
    testRunner.setProperty("regex.result6", "(?s)^(.*)$");
    testRunner.setProperty("regex.result7", "(?s)(XXX)");
    testRunner.enqueue(SAMPLE_STRING.getBytes("UTF-8"));
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(ExtractText.REL_MATCH, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(ExtractText.REL_MATCH).get(0);
    out.replacedertAttributeEquals("regex.result1", SAMPLE_STRING);
    out.replacedertAttributeEquals("regex.result2", "bar1");
    out.replacedertAttributeEquals("regex.result3", "bar1");
    out.replacedertAttributeEquals("regex.result4", "bar2");
    out.replacedertAttributeEquals("regex.result4.0", SAMPLE_STRING);
    out.replacedertAttributeEquals("regex.result4.1", "bar2");
    out.replacedertAttributeEquals("regex.result4.2", "bar3");
    out.replacedertAttributeNotExists("regex.result4.3");
    out.replacedertAttributeEquals("regex.result5", "bar3");
    out.replacedertAttributeEquals("regex.result6", SAMPLE_STRING);
    out.replacedertAttributeEquals("regex.result7", null);
}

13 View Complete Implementation : TestParseSyslog.java
Copyright Apache License 2.0
Author : apache
@Test
public void testValidIPv4Source() {
    final TestRunner runner = TestRunners.newTestRunner(new ParseSyslog());
    runner.enqueue(VALID_MESSAGE_RFC3164_2.getBytes());
    runner.run();
    runner.replacedertAllFlowFilesTransferred(ParseSyslog.REL_SUCCESS, 1);
    final MockFlowFile mff = runner.getFlowFilesForRelationship(ParseSyslog.REL_SUCCESS).get(0);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_BODY.key(), BODY);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_FACILITY.key(), FAC);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_HOSTNAME.key(), IPV4SRC);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_PRIORITY.key(), PRI);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_SEVERITY.key(), SEV);
    mff.replacedertAttributeEquals(SyslogAttributes.SYSLOG_TIMESTAMP.key(), TIME);
}

13 View Complete Implementation : TestPublishKafkaRecord_0_10.java
Copyright Apache License 2.0
Author : apache
@Test
public void testMultipleFailures() throws IOException {
    final Set<FlowFile> flowFiles = new HashSet<>();
    flowFiles.add(runner.enqueue("John Doe, 48"));
    flowFiles.add(runner.enqueue("John Doe, 48"));
    flowFiles.add(runner.enqueue("John Doe, 48"));
    when(mockLease.complete()).thenReturn(createFailurePublishResult(flowFiles));
    runner.run();
    runner.replacedertAllFlowFilesTransferred(PublishKafkaRecord_0_10.REL_FAILURE, 3);
    verify(mockLease, times(3)).publish(any(FlowFile.clreplaced), any(RecordSet.clreplaced), any(RecordSetWriterFactory.clreplaced), AdditionalMatchers.or(any(RecordSchema.clreplaced), isNull()), eq(null), eq(TOPIC_NAME));
    verify(mockLease, times(1)).complete();
    verify(mockLease, times(1)).close();
}

13 View Complete Implementation : TestHBase_2_RecordLookupService.java
Copyright Apache License 2.0
Author : apache
@Test
public void testLookupWhenMissingRowKeyCoordinate() {
    runner.removeProperty(TestRecordLookupProcessor.HBASE_ROW);
    // run the processor
    runner.enqueue("trigger flow file");
    runner.run();
    runner.replacedertAllFlowFilesTransferred(TestRecordLookupProcessor.REL_FAILURE);
    final List<Record> records = testLookupProcessor.getLookedupRecords();
    replacedert.replacedertNotNull(records);
    replacedert.replacedertEquals(0, records.size());
}

13 View Complete Implementation : TestYandexTranslate.java
Copyright Apache License 2.0
Author : apache
@Test
public void testTranslateMultipleAttributes() {
    final TestRunner testRunner = createTestRunner(200);
    testRunner.setProperty(YandexTranslate.KEY, "A");
    testRunner.setProperty(YandexTranslate.SOURCE_LANGUAGE, "fr");
    testRunner.setProperty(YandexTranslate.TARGET_LANGUAGE, "en");
    testRunner.setProperty(YandexTranslate.TRANSLATE_CONTENT, "false");
    testRunner.setProperty(YandexTranslate.CHARACTER_SET, "UTF-8");
    testRunner.setProperty("hello", "bonjour");
    testRunner.setProperty("translate", "traduire");
    testRunner.setProperty("fun", "amusant");
    testRunner.enqueue(new byte[0]);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(YandexTranslate.REL_SUCCESS, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(YandexTranslate.REL_SUCCESS).get(0);
    replacedertEquals(0, out.toByteArray().length);
    out.replacedertAttributeEquals("hello", "hello");
    out.replacedertAttributeEquals("translate", "translate");
    out.replacedertAttributeEquals("fun", "fun");
}

13 View Complete Implementation : PostSlackTextMessageTest.java
Copyright Apache License 2.0
Author : apache
@Test
public void processShouldFailWhenSlackReturnsInvalidJson() {
    testRunner.setProperty(PostSlack.POST_MESSAGE_URL, server.getUrl() + REQUEST_PATH_INVALID_JSON);
    testRunner.setProperty(PostSlack.ACCESS_TOKEN, "my-access-token");
    testRunner.setProperty(PostSlack.CHANNEL, "my-channel");
    testRunner.setProperty(PostSlack.TEXT, "my-text");
    testRunner.enqueue(new byte[0]);
    testRunner.run(1);
    testRunner.replacedertAllFlowFilesTransferred(PutSlack.REL_FAILURE);
}

13 View Complete Implementation : TestYandexTranslate.java
Copyright Apache License 2.0
Author : apache
@Test
public void testTranslateSingleAttribute() {
    final TestRunner testRunner = createTestRunner(200);
    testRunner.setProperty(YandexTranslate.KEY, "A");
    testRunner.setProperty(YandexTranslate.SOURCE_LANGUAGE, "fr");
    testRunner.setProperty(YandexTranslate.TARGET_LANGUAGE, "en");
    testRunner.setProperty(YandexTranslate.TRANSLATE_CONTENT, "false");
    testRunner.setProperty(YandexTranslate.CHARACTER_SET, "UTF-8");
    testRunner.setProperty("translated", "bonjour");
    testRunner.enqueue(new byte[0]);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(YandexTranslate.REL_SUCCESS, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(YandexTranslate.REL_SUCCESS).get(0);
    replacedertEquals(0, out.toByteArray().length);
    out.replacedertAttributeEquals("translated", "hello");
}

13 View Complete Implementation : TestPublishAndSubscribeMqttIntegration.java
Copyright Apache License 2.0
Author : apache
private void publishAndVerify() {
    testPublishRunner.setProperty(PublishMQTT.PROP_BROKER_URI, "tcp://localhost:1883");
    testPublishRunner.setProperty(PublishMQTT.PROP_CLIENTID, "TestPublishClient");
    testPublishRunner.setProperty(PublishMQTT.PROP_QOS, "2");
    testPublishRunner.setProperty(PublishMQTT.PROP_RETAIN, "false");
    testPublishRunner.setProperty(PublishMQTT.PROP_TOPIC, "testTopic");
    testPublishRunner.replacedertValid();
    String testMessage = "testMessage";
    testPublishRunner.enqueue(testMessage.getBytes());
    testPublishRunner.run();
    testPublishRunner.replacedertAllFlowFilesTransferred(REL_SUCCESS);
    testPublishRunner.replacedertTransferCount(REL_SUCCESS, 1);
}

13 View Complete Implementation : TestRetryFlowFile.java
Copyright Apache License 2.0
Author : apache
@Test
public void testRetryPenalize() {
    runner.enqueue("", Collections.singletonMap("flowfile.retries", "2"));
    runner.run();
    runner.replacedertTransferCount(RetryFlowFile.RETRY, 1);
    runner.replacedertTransferCount(RetryFlowFile.RETRIES_EXCEEDED, 0);
    runner.replacedertTransferCount(RetryFlowFile.FAILURE, 0);
    runner.replacedertAllConditionsMet(RetryFlowFile.RETRY, mff -> {
        mff.replacedertAttributeExists("flowfile.retries");
        mff.replacedertAttributeExists("flowfile.retries.uuid");
        mff.replacedertAttributeEquals("flowfile.retries", "3");
        replacedert.replacedertTrue("FlowFile was not penalized!", mff.isPenalized());
        return true;
    });
}

13 View Complete Implementation : ParseEvtxTest.java
Copyright Apache License 2.0
Author : apache
private void testValidEvents(String granularity, String filename, int expectedCount) {
    TestRunner testRunner = TestRunners.newTestRunner(ParseEvtx.clreplaced);
    testRunner.setProperty(ParseEvtx.GRANULARITY, granularity);
    Map<String, String> attributes = new HashMap<>();
    ClreplacedLoader clreplacedLoader = this.getClreplaced().getClreplacedLoader();
    InputStream resourcereplacedtream = clreplacedLoader.getResourcereplacedtream(filename);
    testRunner.enqueue(resourcereplacedtream, attributes);
    testRunner.run();
    testRunner.replacedertTransferCount(ParseEvtx.REL_SUCCESS, expectedCount);
}

13 View Complete Implementation : TestMergeRecord.java
Copyright Apache License 2.0
Author : apache
@Test
@Ignore("This unit test depends on timing and could potentially cause problems in an automated build environment. However, it can be useful for manual testing")
public void testTimeout() throws InterruptedException {
    runner.setProperty(MergeRecord.MIN_RECORDS, "500");
    runner.setProperty(MergeRecord.MAX_BIN_AGE, "500 millis");
    for (int i = 0; i < 100; i++) {
        runner.enqueue("Name, Age\nJohnny, 5");
    }
    runner.run(1, false);
    runner.replacedertTransferCount(MergeRecord.REL_MERGED, 0);
    runner.replacedertTransferCount(MergeRecord.REL_ORIGINAL, 0);
    Thread.sleep(750);
    runner.run(1, true, false);
    runner.replacedertTransferCount(MergeRecord.REL_MERGED, 1);
    runner.replacedertTransferCount(MergeRecord.REL_ORIGINAL, 100);
}

13 View Complete Implementation : TestFuzzyHashContent.java
Copyright Apache License 2.0
Author : apache
@Test
public void testTLSHFuzzyHashInvalidContent() {
    runner.setProperty(FuzzyHashContent.HASH_ALGORITHM, FuzzyHashContent.allowableValueTLSH.getValue());
    runner.enqueue("This is the a short and meaningless sample taste of 'test test test chocolate' " + "an odd test string that is used within some of the NiFi test units. Once day the author of " + "such strings may decide to tell the history behind this sentence and its true meaning...\n");
    runner.run();
    runner.replacedertQueueEmpty();
    runner.replacedertAllFlowFilesTransferred(FuzzyHashContent.REL_FAILURE, 1);
    final MockFlowFile outFile = runner.getFlowFilesForRelationship(FuzzyHashContent.REL_FAILURE).get(0);
    outFile.replacedertAttributeNotExists("fuzzyhash.value");
}

13 View Complete Implementation : TestGeoEnrichIP.java
Copyright Apache License 2.0
Author : apache
@Test
public void shouldFlowToNotFoundWhenNullResponseFromMaxMind() throws Exception {
    testRunner.setProperty(GeoEnrichIP.GEO_DATABASE_FILE, "./");
    testRunner.setProperty(GeoEnrichIP.IP_ADDRESS_ATTRIBUTE, "ip");
    when(databaseReader.city(InetAddress.getByName("1.2.3.4"))).thenReturn(null);
    final Map<String, String> attributes = new HashMap<>();
    attributes.put("ip", "1.2.3.4");
    testRunner.enqueue(new byte[0], attributes);
    testRunner.run();
    List<MockFlowFile> notFound = testRunner.getFlowFilesForRelationship(GeoEnrichIP.REL_NOT_FOUND);
    List<MockFlowFile> found = testRunner.getFlowFilesForRelationship(GeoEnrichIP.REL_FOUND);
    replacedertEquals(1, notFound.size());
    replacedertEquals(0, found.size());
}

13 View Complete Implementation : TestInvokeGroovy.java
Copyright Apache License 2.0
Author : apache
/**
 * Tests a script that throws a ProcessException within. The expected result is that the exception will be
 * propagated
 *
 * @throws Exception Any error encountered while testing
 */
@Test(expected = replacedertionError.clreplaced)
public void testInvokeScriptCausesException() throws Exception {
    final TestRunner runner = TestRunners.newTestRunner(new InvokeScriptedProcessor());
    runner.setProperty(scriptingComponent.getScriptingComponentHelper().SCRIPT_ENGINE, "Groovy");
    runner.setProperty(ScriptingComponentUtils.SCRIPT_BODY, getFileContentsreplacedtring(TEST_RESOURCE_LOCATION + "groovy/testInvokeScriptCausesException.groovy"));
    runner.replacedertValid();
    runner.enqueue("test content".getBytes(StandardCharsets.UTF_8));
    runner.run();
}

13 View Complete Implementation : TestLookupRecord.java
Copyright Apache License 2.0
Author : apache
@Test
public void testResultPathNotFound() {
    runner.setProperty(LookupRecord.RESULT_RECORD_PATH, "/other");
    lookupService.addValue("John Doe", "Soccer");
    lookupService.addValue("Jane Doe", "Basketball");
    lookupService.addValue("Jimmy Doe", "Football");
    runner.enqueue("");
    runner.run();
    runner.replacedertAllFlowFilesTransferred(LookupRecord.REL_MATCHED, 1);
    final MockFlowFile out = runner.getFlowFilesForRelationship(LookupRecord.REL_MATCHED).get(0);
    out.replacedertAttributeEquals("record.count", "3");
    out.replacedertAttributeEquals("mime.type", "text/plain");
    out.replacedertContentEquals("John Doe,48,,Soccer\nJane Doe,47,,Basketball\nJimmy Doe,14,,Football\n");
}

12 View Complete Implementation : TestEvaluateXQuery.java
Copyright Apache License 2.0
Author : apache
@Test
public void testWriteStringToContent() throws XPathFactoryConfigurationException, IOException {
    final TestRunner testRunner = TestRunners.newTestRunner(new EvaluateXQuery());
    testRunner.setProperty(EvaluateXQuery.DESTINATION, EvaluateXQuery.DESTINATION_CONTENT);
    testRunner.setProperty("some.property", "/*:fruitbasket/fruit[1]/name/text()");
    testRunner.enqueue(XML_SNIPPET);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(EvaluateXQuery.REL_MATCH, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(EvaluateXQuery.REL_MATCH).get(0);
    final byte[] outData = testRunner.getContentAsByteArray(out);
    final String outXml = new String(outData, "UTF-8");
    replacedertTrue(outXml.trim().equals("apple"));
}

12 View Complete Implementation : TestJSONToAvroProcessor.java
Copyright Apache License 2.0
Author : apache
@Test
public void testBasicConversionWithCompression() throws IOException {
    TestRunner runner = TestRunners.newTestRunner(ConvertJSONToAvro.clreplaced);
    runner.replacedertNotValid();
    runner.setProperty(ConvertJSONToAvro.SCHEMA, SCHEMA.toString());
    runner.setProperty(AbstractKiteConvertProcessor.COMPRESSION_TYPE, CodecType.NONE.toString());
    runner.replacedertValid();
    runner.enqueue(streamFor(JSON_CONTENT));
    runner.run();
    long converted = runner.getCounterValue("Converted records");
    long errors = runner.getCounterValue("Conversion errors");
    replacedert.replacedertEquals("Should convert 2 rows", 2, converted);
    replacedert.replacedertEquals("Should reject 3 rows", 3, errors);
    runner.replacedertTransferCount("success", 1);
    runner.replacedertTransferCount("failure", 0);
    runner.replacedertTransferCount("incompatible", 1);
    MockFlowFile incompatible = runner.getFlowFilesForRelationship("incompatible").get(0);
    String failureContent = new String(runner.getContentAsByteArray(incompatible), StandardCharsets.UTF_8);
    replacedert.replacedertEquals("Should reject an invalid string and double", JSON_CONTENT, failureContent);
    replacedert.replacedertEquals("Should acreplacedulate error messages", FAILURE_SUMMARY, incompatible.getAttribute("errors"));
}

12 View Complete Implementation : TestJSONToAvroProcessor.java
Copyright Apache License 2.0
Author : apache
@Test
public void testOnlyErrors() throws IOException {
    TestRunner runner = TestRunners.newTestRunner(ConvertJSONToAvro.clreplaced);
    runner.replacedertNotValid();
    runner.setProperty(ConvertJSONToAvro.SCHEMA, SCHEMA.toString());
    runner.replacedertValid();
    runner.enqueue(streamFor(FAILURE_CONTENT));
    runner.run();
    long converted = runner.getCounterValue("Converted records");
    long errors = runner.getCounterValue("Conversion errors");
    replacedert.replacedertEquals("Should convert 0 rows", 0, converted);
    replacedert.replacedertEquals("Should reject 1 row", 3, errors);
    runner.replacedertTransferCount("success", 0);
    runner.replacedertTransferCount("failure", 1);
    runner.replacedertTransferCount("incompatible", 0);
    MockFlowFile incompatible = runner.getFlowFilesForRelationship("failure").get(0);
    replacedert.replacedertEquals("Should set an error message", FAILURE_SUMMARY, incompatible.getAttribute("errors"));
}

12 View Complete Implementation : TestJoltTransformRecord.java
Copyright Apache License 2.0
Author : apache
@Test
public void testCustomTransformationWithInvalidClreplacedPath() throws IOException {
    final String customJarPath = "src/test/resources/TestJoltTransformRecord/FakeCustomJar.jar";
    final String spec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestJoltTransformRecord/chainrSpec.json")));
    runner.setProperty(JoltTransformRecord.JOLT_SPEC, spec);
    runner.setProperty(JoltTransformRecord.CUSTOM_CLreplaced, "TestCustomJoltTransform");
    runner.setProperty(JoltTransformRecord.MODULES, customJarPath);
    runner.setProperty(JoltTransformRecord.JOLT_TRANSFORM, JoltTransformRecord.CUSTOMR);
    runner.enqueue(new byte[0]);
    runner.replacedertNotValid();
}

12 View Complete Implementation : TestPutKinesisFirehose.java
Copyright Apache License 2.0
Author : apache
@Test
public void testWithSizeGreaterThan1MB() {
    runner.setProperty(PutKinesisFirehose.BATCH_SIZE, "1");
    runner.replacedertValid();
    byte[] bytes = new byte[(PutKinesisFirehose.MAX_MESSAGE_SIZE + 1)];
    for (int i = 0; i < bytes.length; i++) {
        bytes[i] = 'a';
    }
    runner.enqueue(bytes);
    runner.run(1);
    runner.replacedertAllFlowFilesTransferred(PutKinesisFirehose.REL_FAILURE, 1);
    List<MockFlowFile> flowFiles = runner.getFlowFilesForRelationship(PutKinesisFirehose.REL_FAILURE);
    replacedertNotNull(flowFiles.get(0).getAttribute(PutKinesisFirehose.AWS_KINESIS_FIREHOSE_ERROR_MESSAGE));
}

12 View Complete Implementation : TestJoltTransformJSON.java
Copyright Apache License 2.0
Author : apache
@Test
public void testCustomTransformationWithInvalidClreplacedPath() throws IOException {
    final TestRunner runner = TestRunners.newTestRunner(new JoltTransformJSON());
    final String customJarPath = "src/test/resources/TestJoltTransformJson/FakeCustomJar.jar";
    final String spec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestJoltTransformJson/chainrSpec.json")));
    runner.setProperty(JoltTransformJSON.JOLT_SPEC, spec);
    runner.setProperty(JoltTransformJSON.CUSTOM_CLreplaced, "TestCustomJoltTransform");
    runner.setProperty(JoltTransformJSON.MODULES, customJarPath);
    runner.setProperty(JoltTransformJSON.JOLT_TRANSFORM, JoltTransformJSON.CUSTOMR);
    runner.enqueue(JSON_INPUT);
    runner.replacedertNotValid();
}

12 View Complete Implementation : TestLogAttribute.java
Copyright Apache License 2.0
Author : apache
@Test
public void testLogPropertyWithIgnoreCSV() {
    final LogAttribute logAttribute = new LogAttribute();
    final TestRunner runner = TestRunners.newTestRunner(logAttribute);
    final ProcessContext context = runner.getProcessContext();
    final ProcessSession session = runner.getProcessSessionFactory().createSession();
    final MockComponentLog LOG = runner.getLogger();
    runner.setProperty(LogAttribute.ATTRIBUTES_TO_IGNORE_CSV, "bar");
    final Map<String, String> attrs = Maps.newHashMap();
    attrs.put("foo", "foo-value");
    attrs.put("bar", "bar-value");
    attrs.put("foobaz", "foobaz-value");
    final MockFlowFile flowFile = runner.enqueue("content", attrs);
    final String logMessage = logAttribute.processFlowFile(LOG, LogAttribute.DebugLevels.info, flowFile, session, context);
    replacedertThat(logMessage, containsString("foobaz-value"));
    replacedertThat(logMessage, containsString("foo-value"));
    replacedertThat(logMessage, not(containsString("bar-value")));
}

12 View Complete Implementation : TestGetHTMLElement.java
Copyright Apache License 2.0
Author : apache
@Test
public void testNoElementFound() throws Exception {
    // Bold element is not present in sample HTML
    testRunner.setProperty(GetHTMLElement.CSS_SELECTOR, "b");
    testRunner.enqueue(new File("src/test/resources/Weather.html").toPath());
    testRunner.run();
    testRunner.replacedertTransferCount(GetHTMLElement.REL_SUCCESS, 0);
    testRunner.replacedertTransferCount(GetHTMLElement.REL_INVALID_HTML, 0);
    testRunner.replacedertTransferCount(GetHTMLElement.REL_NOT_FOUND, 1);
}

12 View Complete Implementation : PutParquetTest.java
Copyright Apache License 2.0
Author : apache
@Test
public void testIOExceptionCreatingWriterShouldRouteToRetry() throws InitializationException, IOException, MalformedRecordException {
    final PutParquet proc = new PutParquet() {

        @Override
        public HDFSRecordWriter createHDFSRecordWriter(ProcessContext context, FlowFile flowFile, Configuration conf, Path path, RecordSchema schema) throws IOException, SchemaNotFoundException {
            throw new IOException("IOException");
        }
    };
    configure(proc, 0);
    final String filename = "testMalformedRecordExceptionShouldRouteToFailure-" + System.currentTimeMillis();
    final Map<String, String> flowFileAttributes = new HashMap<>();
    flowFileAttributes.put(CoreAttributes.FILENAME.key(), filename);
    testRunner.enqueue("trigger", flowFileAttributes);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(PutParquet.REL_RETRY, 1);
}

12 View Complete Implementation : TestConvertCharacterSet.java
Copyright Apache License 2.0
Author : apache
@Test
public void testSimple() throws IOException {
    final TestRunner runner = TestRunners.newTestRunner(new ConvertCharacterSet());
    runner.setProperty(ConvertCharacterSet.INPUT_CHARSET, "ASCII");
    runner.setProperty(ConvertCharacterSet.OUTPUT_CHARSET, "UTF-32");
    runner.enqueue(Paths.get("src/test/resources/CharacterSetConversionSamples/Original.txt"));
    runner.run();
    runner.replacedertAllFlowFilesTransferred(ConvertCharacterSet.REL_SUCCESS, 1);
    final MockFlowFile output = runner.getFlowFilesForRelationship(ConvertCharacterSet.REL_SUCCESS).get(0);
    output.replacedertContentEquals(new File("src/test/resources/CharacterSetConversionSamples/Converted2.txt"));
}

12 View Complete Implementation : TestUpdateRecord.java
Copyright Apache License 2.0
Author : apache
@Test
public void testLiteralReplacementValue() {
    runner.setProperty("/name", "Jane Doe");
    runner.enqueue("");
    readerService.addRecord("John Doe", 35);
    runner.run();
    runner.replacedertAllFlowFilesTransferred(UpdateRecord.REL_SUCCESS, 1);
    final MockFlowFile out = runner.getFlowFilesForRelationship(UpdateRecord.REL_SUCCESS).get(0);
    out.replacedertContentEquals("header\nJane Doe,35\n");
}

12 View Complete Implementation : TestMergeRecord.java
Copyright Apache License 2.0
Author : apache
@Test
public void testMinRecords() {
    runner.setProperty(MergeRecord.MIN_RECORDS, "103");
    runner.setProperty(MergeRecord.MAX_RECORDS, "110");
    runner.setProperty(MergeRecord.MIN_SIZE, "500 B");
    runner.enqueue("Name, Age\nJohn, 35");
    runner.enqueue("Name, Age\nJane, 34");
    final StringBuilder sb = new StringBuilder("Name, Age\n");
    for (int i = 0; i < 100; i++) {
        sb.append("Person " + i + ", " + i + "\n");
    }
    runner.enqueue(sb.toString());
    runner.run();
    runner.replacedertTransferCount(MergeRecord.REL_MERGED, 0);
    runner.replacedertTransferCount(MergeRecord.REL_ORIGINAL, 0);
    runner.enqueue("Name, Age\nJohn, 35");
    runner.run(2);
    runner.replacedertTransferCount(MergeRecord.REL_MERGED, 1);
    runner.replacedertTransferCount(MergeRecord.REL_ORIGINAL, 4);
}

12 View Complete Implementation : TestPutRecord.java
Copyright Apache License 2.0
Author : apache
@Test
public void testNoRows() throws Exception {
    testRunner.addControllerService("reader", recordReader);
    testRunner.enableControllerService(recordReader);
    testRunner.addControllerService("MockRecordSinkService", mockRecordSinkService);
    testRunner.enableControllerService(mockRecordSinkService);
    testRunner.setProperty(PutRecord.INCLUDE_ZERO_RECORD_RESULTS, "false");
    recordReader.addSchemaField("name", RecordFieldType.STRING);
    recordReader.addSchemaField("age", RecordFieldType.INT);
    recordReader.addSchemaField("sport", RecordFieldType.STRING);
    testRunner.enqueue("");
    testRunner.run();
    replacedertTrue(mockRecordSinkService.getRows().isEmpty());
    replacedertFalse(mockRecordSinkService.isTransmitted());
    // Original flow file is still transferred
    testRunner.replacedertAllFlowFilesTransferred(PutRecord.REL_SUCCESS, 1);
    testRunner.clearTransferState();
    // Send an empty record set anyway
    testRunner.setProperty(PutRecord.INCLUDE_ZERO_RECORD_RESULTS, "true");
    testRunner.enqueue("");
    testRunner.run();
    replacedertTrue(mockRecordSinkService.getRows().isEmpty());
    replacedertTrue(mockRecordSinkService.isTransmitted());
    // Original flow file is still transferred
    testRunner.replacedertAllFlowFilesTransferred(PutRecord.REL_SUCCESS, 1);
}

12 View Complete Implementation : TestEvaluateXQuery.java
Copyright Apache License 2.0
Author : apache
@Test
public void testUnmatchedAttribute() throws XPathFactoryConfigurationException, IOException {
    final TestRunner testRunner = TestRunners.newTestRunner(new EvaluateXQuery());
    testRunner.setProperty(EvaluateXQuery.DESTINATION, EvaluateXQuery.DESTINATION_ATTRIBUTE);
    testRunner.setProperty("xquery.result.exist.2", "/*:fruitbasket/node2");
    testRunner.enqueue(XML_SNIPPET);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(EvaluateXQuery.REL_NO_MATCH, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(EvaluateXQuery.REL_NO_MATCH).get(0);
    out.replacedertAttributeEquals("xquery.result.exist.2", null);
    testRunner.getFlowFilesForRelationship(EvaluateXQuery.REL_NO_MATCH).get(0).replacedertContentEquals(XML_SNIPPET);
}

12 View Complete Implementation : TestJSONToAvroProcessor.java
Copyright Apache License 2.0
Author : apache
@Test
public void testEmptyContent() throws IOException {
    TestRunner runner = TestRunners.newTestRunner(ConvertJSONToAvro.clreplaced);
    runner.replacedertNotValid();
    runner.setProperty(ConvertJSONToAvro.SCHEMA, SCHEMA.toString());
    runner.replacedertValid();
    runner.enqueue(streamFor(""));
    runner.run();
    long converted = runner.getCounterValue("Converted records");
    long errors = runner.getCounterValue("Conversion errors");
    replacedert.replacedertEquals("Should convert 0 rows", 0, converted);
    replacedert.replacedertEquals("Should reject 0 row", 0, errors);
    runner.replacedertTransferCount("success", 0);
    runner.replacedertTransferCount("failure", 1);
    runner.replacedertTransferCount("incompatible", 0);
    MockFlowFile incompatible = runner.getFlowFilesForRelationship("failure").get(0);
    replacedert.replacedertEquals("Should set an error message", "No incoming records", incompatible.getAttribute("errors"));
}

12 View Complete Implementation : TestGeoEnrichIP.java
Copyright Apache License 2.0
Author : apache
@SuppressWarnings("unchecked")
@Test
public void whenInetAddressThrowsUnknownHostFlowFileShouldBeSentToNotFound() throws Exception {
    testRunner.setProperty(GeoEnrichIP.GEO_DATABASE_FILE, "./");
    testRunner.setProperty(GeoEnrichIP.IP_ADDRESS_ATTRIBUTE, "ip");
    final Map<String, String> attributes = new HashMap<>();
    attributes.put("ip", "somenonexistentdomain.comm");
    when(InetAddress.getByName("somenonexistentdomain.comm")).thenThrow(UnknownHostException.clreplaced);
    testRunner.enqueue(new byte[0], attributes);
    testRunner.run();
    List<MockFlowFile> notFound = testRunner.getFlowFilesForRelationship(GeoEnrichIP.REL_NOT_FOUND);
    List<MockFlowFile> found = testRunner.getFlowFilesForRelationship(GeoEnrichIP.REL_FOUND);
    replacedertEquals(1, notFound.size());
    replacedertEquals(0, found.size());
    verify(databaseReader).close();
    verifyNoMoreInteractions(databaseReader);
}

12 View Complete Implementation : TestSegmentContent.java
Copyright Apache License 2.0
Author : apache
@Test
public void test() throws IOException {
    final TestRunner testRunner = TestRunners.newTestRunner(new SegmentContent());
    testRunner.setProperty(SegmentContent.SIZE, "4 B");
    testRunner.enqueue(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
    testRunner.run();
    testRunner.replacedertTransferCount(SegmentContent.REL_ORIGINAL, 1);
    final MockFlowFile originalFlowFile = testRunner.getFlowFilesForRelationship(SegmentContent.REL_ORIGINAL).get(0);
    originalFlowFile.replacedertAttributeExists(SegmentContent.FRAGMENT_ID);
    originalFlowFile.replacedertAttributeEquals(SegmentContent.FRAGMENT_COUNT, "3");
    final List<MockFlowFile> flowFiles = testRunner.getFlowFilesForRelationship(SegmentContent.REL_SEGMENTS);
    replacedertEquals(3, flowFiles.size());
    final MockFlowFile out1 = flowFiles.get(0);
    final MockFlowFile out2 = flowFiles.get(1);
    final MockFlowFile out3 = flowFiles.get(2);
    out1.replacedertContentEquals(new byte[] { 1, 2, 3, 4 });
    out2.replacedertContentEquals(new byte[] { 5, 6, 7, 8 });
    out3.replacedertContentEquals(new byte[] { 9 });
}

12 View Complete Implementation : PutParquetTest.java
Copyright Apache License 2.0
Author : apache
@Test
public void testInvalidDictionaryPageSizeFromELShouldRouteToFailure() throws IOException, InitializationException {
    configure(proc, 10);
    testRunner.setProperty(ParquetUtils.DICTIONARY_PAGE_SIZE, "${dictionary.page.size}");
    final String filename = "testInvalidDictionaryPageSizeFromELShouldRouteToFailure" + System.currentTimeMillis();
    final Map<String, String> flowFileAttributes = new HashMap<>();
    flowFileAttributes.put(CoreAttributes.FILENAME.key(), filename);
    flowFileAttributes.put("dictionary.page.size", "NOT A DATA SIZE");
    testRunner.enqueue("trigger", flowFileAttributes);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(PutParquet.REL_FAILURE, 1);
}

12 View Complete Implementation : TestGetHTMLElement.java
Copyright Apache License 2.0
Author : apache
@Test
public void testSingleElementFound() throws Exception {
    testRunner.setProperty(GetHTMLElement.CSS_SELECTOR, "head");
    testRunner.enqueue(new File("src/test/resources/Weather.html").toPath());
    testRunner.run();
    testRunner.replacedertTransferCount(GetHTMLElement.REL_SUCCESS, 1);
    testRunner.replacedertTransferCount(GetHTMLElement.REL_INVALID_HTML, 0);
    testRunner.replacedertTransferCount(GetHTMLElement.REL_ORIGINAL, 1);
    testRunner.replacedertTransferCount(GetHTMLElement.REL_NOT_FOUND, 0);
}

12 View Complete Implementation : TestPutHBaseJSON.java
Copyright Apache License 2.0
Author : apache
@Test
public void testInvalidJson() throws InitializationException {
    final TestRunner runner = getTestRunner(DEFAULT_TABLE_NAME, DEFAULT_COLUMN_FAMILY, "1");
    getHBaseClientService(runner);
    runner.setProperty(PutHBaseJSON.ROW_ID, DEFAULT_ROW);
    final String content = "NOT JSON";
    runner.enqueue(content.getBytes(StandardCharsets.UTF_8));
    runner.run();
    runner.replacedertAllFlowFilesTransferred(PutHBaseCell.REL_FAILURE, 1);
}

12 View Complete Implementation : TestPutSplunk.java
Copyright Apache License 2.0
Author : apache
@Test
public void testTCPSendDelimitedMessages() {
    final String delimiter = "DD";
    runner.setProperty(PutSplunk.MESSAGE_DELIMITER, delimiter);
    runner.setProperty(PutSplunk.PROTOCOL, PutSplunk.TCP_VALUE.getValue());
    // no delimiter at end
    final String message = "This is message 1DDThis is message 2DDThis is message 3";
    runner.enqueue(message);
    runner.run(1);
    runner.replacedertAllFlowFilesTransferred(PutSplunk.REL_SUCCESS, 1);
    final MockFlowFile mockFlowFile = runner.getFlowFilesForRelationship(PutSplunk.REL_SUCCESS).get(0);
    mockFlowFile.replacedertContentEquals(message);
    replacedert.replacedertEquals(3, sender.getMessages().size());
    replacedert.replacedertEquals("This is message 1\n", sender.getMessages().get(0));
    replacedert.replacedertEquals("This is message 2\n", sender.getMessages().get(1));
    replacedert.replacedertEquals("This is message 3\n", sender.getMessages().get(2));
}

12 View Complete Implementation : TestInvokeJavascript.java
Copyright Apache License 2.0
Author : apache
/**
 * Tests a script that throws a ProcessException within.
 * The expected result is that the exception will be propagated.
 *
 * @throws Exception Any error encountered while testing
 */
@Test(expected = replacedertionError.clreplaced)
public void testInvokeScriptCausesException() throws Exception {
    final TestRunner runner = TestRunners.newTestRunner(new InvokeScriptedProcessor());
    runner.setValidateExpressionUsage(false);
    runner.setProperty(scriptingComponent.getScriptingComponentHelper().SCRIPT_ENGINE, "ECMAScript");
    runner.setProperty(ScriptingComponentUtils.SCRIPT_BODY, getFileContentsreplacedtring(TEST_RESOURCE_LOCATION + "javascript/testInvokeScriptCausesException.js"));
    runner.replacedertValid();
    runner.enqueue("test content".getBytes(StandardCharsets.UTF_8));
    runner.run();
}

12 View Complete Implementation : TestRouteOnContent.java
Copyright Apache License 2.0
Author : apache
@Test
public void testSubsreplaceduteAttributes() throws IOException {
    final TestRunner runner = TestRunners.newTestRunner(new RouteOnContent());
    runner.setProperty(RouteOnContent.MATCH_REQUIREMENT, RouteOnContent.MATCH_SUBSEQUENCE);
    runner.setProperty("attr", "Hel${highLow}");
    final Map<String, String> attributes = new HashMap<>();
    attributes.put("highLow", "lo");
    runner.enqueue(Paths.get("src/test/resources/hello.txt"), attributes);
    runner.run();
    runner.replacedertAllFlowFilesTransferred("attr", 1);
}

12 View Complete Implementation : PostSlackTextMessageTest.java
Copyright Apache License 2.0
Author : apache
@Test
public void sendTextWithAttachmentMessageSuccessfully() {
    testRunner.setProperty(PostSlack.POST_MESSAGE_URL, server.getUrl() + REQUEST_PATH_SUCCESS_TEXT_MSG);
    testRunner.setProperty(PostSlack.ACCESS_TOKEN, "my-access-token");
    testRunner.setProperty(PostSlack.CHANNEL, "my-channel");
    testRunner.setProperty(PostSlack.TEXT, "my-text");
    testRunner.setProperty("attachment_01", "{\"my-attachment-key\": \"my-attachment-value\"}");
    testRunner.enqueue(new byte[0]);
    testRunner.run(1);
    testRunner.replacedertAllFlowFilesTransferred(PutSlack.REL_SUCCESS);
    JsonObject requestBodyJson = getRequestBodyJson();
    replacedertBasicRequest(requestBodyJson);
    replacedertEquals("my-text", requestBodyJson.getString("text"));
    replacedertEquals("[{\"my-attachment-key\":\"my-attachment-value\"}]", requestBodyJson.getJsonArray("attachments").toString());
}

12 View Complete Implementation : TestYandexTranslate.java
Copyright Apache License 2.0
Author : apache
@Test
public void testTranslateContentAndMultipleAttributes() {
    final TestRunner testRunner = createTestRunner(200);
    testRunner.setProperty(YandexTranslate.KEY, "A");
    testRunner.setProperty(YandexTranslate.SOURCE_LANGUAGE, "fr");
    testRunner.setProperty(YandexTranslate.TARGET_LANGUAGE, "en");
    testRunner.setProperty(YandexTranslate.TRANSLATE_CONTENT, "true");
    testRunner.setProperty(YandexTranslate.CHARACTER_SET, "UTF-8");
    testRunner.setProperty("hello", "bonjour");
    testRunner.setProperty("translate", "traduire");
    testRunner.setProperty("fun", "amusant");
    testRunner.setProperty("nifi", "nifi");
    testRunner.enqueue("ordinateur".getBytes());
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(YandexTranslate.REL_SUCCESS, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(YandexTranslate.REL_SUCCESS).get(0);
    out.replacedertContentEquals("computer");
    out.replacedertAttributeEquals("hello", "hello");
    out.replacedertAttributeEquals("translate", "translate");
    out.replacedertAttributeEquals("fun", "fun");
    out.replacedertAttributeEquals("nifi", "nifi");
}

12 View Complete Implementation : TestRouteText.java
Copyright Apache License 2.0
Author : apache
@Test
public void testSimpleDefaultMatchRegularExpression() throws IOException {
    final TestRunner runner = TestRunners.newTestRunner(new RouteText());
    runner.setProperty(RouteText.MATCH_STRATEGY, RouteText.MATCHES_REGULAR_EXPRESSION);
    runner.setProperty("simple", ".*(mid).*");
    runner.enqueue("start middle end\nnot match".getBytes("UTF-8"));
    runner.run();
    runner.replacedertTransferCount("simple", 1);
    runner.replacedertTransferCount("unmatched", 1);
    runner.replacedertTransferCount("original", 1);
    final MockFlowFile outMatched = runner.getFlowFilesForRelationship("simple").get(0);
    outMatched.replacedertContentEquals("start middle end\n".getBytes("UTF-8"));
    final MockFlowFile outUnmatched = runner.getFlowFilesForRelationship("unmatched").get(0);
    outUnmatched.replacedertContentEquals("not match".getBytes("UTF-8"));
}

12 View Complete Implementation : PostSlackTextMessageTest.java
Copyright Apache License 2.0
Author : apache
@Test
public void processShouldFailWhenChannelIsEmpty() {
    testRunner.setProperty(PostSlack.POST_MESSAGE_URL, server.getUrl());
    testRunner.setProperty(PostSlack.ACCESS_TOKEN, "my-access-token");
    testRunner.setProperty(PostSlack.CHANNEL, "${dummy}");
    testRunner.setProperty(PostSlack.TEXT, "my-text");
    testRunner.enqueue(new byte[0]);
    testRunner.run(1);
    testRunner.replacedertAllFlowFilesTransferred(PutSlack.REL_FAILURE);
    replacedertFalse(servlet.hasBeenInteracted());
}

12 View Complete Implementation : TestEvaluateXQuery.java
Copyright Apache License 2.0
Author : apache
@Test
public void testWriteStringToAttribute() throws XPathFactoryConfigurationException, IOException {
    final TestRunner testRunner = TestRunners.newTestRunner(new EvaluateXQuery());
    testRunner.setProperty(EvaluateXQuery.DESTINATION, EvaluateXQuery.DESTINATION_ATTRIBUTE);
    testRunner.setProperty("xquery.result2", "/*:fruitbasket/fruit[1]/name/text()");
    testRunner.enqueue(XML_SNIPPET);
    testRunner.run();
    testRunner.replacedertAllFlowFilesTransferred(EvaluateXQuery.REL_MATCH, 1);
    final MockFlowFile out = testRunner.getFlowFilesForRelationship(EvaluateXQuery.REL_MATCH).get(0);
    out.replacedertAttributeEquals("xquery.result2", "apple");
    testRunner.getFlowFilesForRelationship(EvaluateXQuery.REL_MATCH).get(0).replacedertContentEquals(XML_SNIPPET);
}

12 View Complete Implementation : TestRouteOnContent.java
Copyright Apache License 2.0
Author : apache
@Test
public void testBufferSize() throws IOException {
    final TestRunner runner = TestRunners.newTestRunner(new RouteOnContent());
    runner.setProperty(RouteOnContent.MATCH_REQUIREMENT, RouteOnContent.MATCH_ALL);
    runner.setProperty(RouteOnContent.BUFFER_SIZE, "3 B");
    runner.setProperty("rel", "Hel");
    runner.enqueue(Paths.get("src/test/resources/hello.txt"));
    runner.run();
    runner.replacedertAllFlowFilesTransferred("rel", 1);
}

12 View Complete Implementation : TestPutDistributedMapCache.java
Copyright Apache License 2.0
Author : apache
@Test
public void testNoCacheKey() throws InitializationException {
    runner.setProperty(PutDistributedMapCache.CACHE_ENTRY_IDENTIFIER, "${cacheKeyAttribute}");
    runner.enqueue(new byte[] {});
    runner.run();
    // no cache key attribute
    runner.replacedertAllFlowFilesTransferred(PutDistributedMapCache.REL_FAILURE, 1);
    runner.replacedertTransferCount(PutDistributedMapCache.REL_FAILURE, 1);
    runner.clearTransferState();
}