kafkaComponent.writeMessages(sensorType, inputMessages);
KafkaProcessor<Map<String, List<JSONObject>>> kafkaProcessor = getKafkaProcessor(
parserConfig.getOutputTopic(), parserConfig.getErrorTopic());
ProcessorResult<Map<String, List<JSONObject>>> result = runner.process(kafkaProcessor);
Assert.assertEquals(1, outputMessages.get(Constants.ENRICHMENT_TOPIC).size());
Assert.assertEquals("valid", outputMessages.get(Constants.ENRICHMENT_TOPIC).get(0).get("action"));
Assert.assertEquals(2, outputMessages.get(parserConfig.getErrorTopic()).size());
JSONObject invalidMessage = outputMessages.get(parserConfig.getErrorTopic()).get(0);
Assert.assertEquals(Constants.ErrorType.PARSER_INVALID.getType(), invalidMessage.get(Constants.ErrorFields.ERROR_TYPE.getName()));
JSONObject rawMessage = JSONUtils.INSTANCE.load((String) invalidMessage.get(Constants.ErrorFields.RAW_MESSAGE.getName()), JSONObject.class);
JSONObject errorMessage = outputMessages.get(parserConfig.getErrorTopic()).get(1);
Assert.assertEquals(Constants.ErrorType.PARSER_ERROR.getType(), errorMessage.get(Constants.ErrorFields.ERROR_TYPE.getName()));
Assert.assertEquals("error", errorMessage.get(Constants.ErrorFields.RAW_MESSAGE.getName()));