kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Chambers <achambers.h...@gmail.com>
Subject Re: MockClientSupplier
Date Mon, 12 Sep 2016 09:56:25 GMT
Thanks Guozhang,

Actually on inspection, the MockClientSupplier itself seems easy enough to
replicate. But now I have a question about the MockConsumer. I expected to
be able to use the MockConsumer to simulate input events but when I try to
add a record, I get:

   Cannot add records for a partition that is not assigned to the
   consumer

I'd have thought the app under test would have caused the mock consumer to
subscribe to the input topic. I tried to verify this without even producing
a record by checking the "subscription" method of the mock consumer but
that returns an empty set even after the app streams have been started.

Is there any way to inspect the topology of a streams app? I think that's
what I'd really like to test. The transformations/aggregations themselves
are obviously easier to test independently of kafka. It might be nice to
just check they are all glued together correctly.

Cheers,
Andy



On Sun, Sep 11, 2016 at 8:56 PM, Guozhang Wang <wangguoz@gmail.com> wrote:

> Hello Andy,
>
> Unfortunately the included package `o.a.k.test` is not included in the
> released maven.
>
> There are some discussions about moving these test fixtures into public
> packages:
>
> https://issues.apache.org/jira/browse/KAFKA-3625
>
> Guozhang
>
> On Sat, Sep 10, 2016 at 2:01 PM, Andy Chambers <achambers.home@gmail.com>
> wrote:
>
> > Hi,
> >
> > The MockClientSupplier looks like it would be useful for developers
> wishing
> > to write unit tests for kafka streams apps. Is it public? If so, can
> > someone help me out with the maven coordinates. Currently depending on
> > these maven coordinates
> >
> >   [org.apache.kafka/kafka-streams "0.10.0.1"]
> >   [org.apache.kafka/kafka-clients "0.10.0.1"]
> >   [org.apache.kafka/kafka_2.11 "0.10.0.1"]
> >
> > but none seem to include the class org.apache.kafka.test.
> > MockClientSupplier
> >
> > Cheers,
> > Andy
> >
>
>
>
> --
> -- Guozhang
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message