Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id E178A200B40 for ; Fri, 1 Jul 2016 18:56:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id E02A2160A6C; Fri, 1 Jul 2016 16:56:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5B620160A61 for ; Fri, 1 Jul 2016 18:56:12 +0200 (CEST) Received: (qmail 11195 invoked by uid 500); 1 Jul 2016 16:56:11 -0000 Mailing-List: contact dev-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kafka.apache.org Delivered-To: mailing list dev@kafka.apache.org Received: (qmail 11161 invoked by uid 99); 1 Jul 2016 16:56:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jul 2016 16:56:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 174602C02A4 for ; Fri, 1 Jul 2016 16:56:11 +0000 (UTC) Date: Fri, 1 Jul 2016 16:56:11 +0000 (UTC) From: "Guozhang Wang (JIRA)" To: dev@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KAFKA-3538) Abstract the creation/retrieval of Producer for stream sinks for unit testing MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 01 Jul 2016 16:56:13 -0000 [ https://issues.apache.org/jira/browse/KAFKA-3538?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15359264#comment-15359264 ] Guozhang Wang commented on KAFKA-3538: -------------------------------------- [~mdcoon] I think this has been fixed as in https://issues.apache.org/jira/browse/KAFKA-3616, hence resolving this ticket. > Abstract the creation/retrieval of Producer for stream sinks for unit testing > ----------------------------------------------------------------------------- > > Key: KAFKA-3538 > URL: https://issues.apache.org/jira/browse/KAFKA-3538 > Project: Kafka > Issue Type: New Feature > Components: streams > Affects Versions: 0.10.1.0 > Reporter: Michael Coon > Assignee: Guozhang Wang > Priority: Minor > Labels: semantics > Fix For: 0.10.1.0 > > > The StreamThread creates producer/consumers directly as KafkaProducer and KafkaConsumer, thus eliminating my ability to unit test my streams code without having an active Kafka nearby. Could this be abstracted in a way that it relies on an optional ProducerProvider or ConsumerProvider implementation that could inject a mock producer/consumer for unit testing? We do this in all our kafka code for unit testing and if a provider is not offered at runtime, we create the concrete KafkaProdocer/Consumer components by default. -- This message was sent by Atlassian JIRA (v6.3.4#6332)