Some other examples are here:

https://github.com/apache/storm/blob/master/external/storm-hdfs/src/test/java/org/apache/storm/hdfs/bolt/AvroGenericRecordBoltTest.java

The Hive test bolt also does some sophisticated tests with Mockito spys:

https://github.com/apache/storm/blob/master/external/storm-hive/src/test/java/org/apache/storm/hive/bolt/TestHiveBolt.java#L310

On Wed, May 3, 2017 at 10:54 AM Artem Ervits <[email protected]> wrote:

> in my experience, I used some of the examples in the Storm built-in tests
> to mock bolts. In that case, it wasn't necessary to run topologies. Here's
> an example of
> https://github.com/apache/storm/blob/a4afacd9617d620f50cf026fc599821f7ac25c79/storm-client/test/jvm/org/apache/storm/bolt/TestJoinBolt.java
>
> On Wed, May 3, 2017 at 11:27 AM, Ramin Farajollah (BLOOMBERG/ 731 LEX) <
> [email protected]> wrote:
>
>> Hi,
>>
>> What is the recommended strategy for unit testing spouts and bolts of a
>> topology?
>>
>> Is a running Storm topology required to do so?
>>
>>
>> For example, what is the suggestion for creating a BaseRichSpout instance
>> and
>> arguments to BaseRichSpout::open() and possibly populating them?
>>
>>
>> Note: my question is not about specifics of each application, which of
>> course would be different.
>>
>>
>>
>>
>>
>> << �gA mind is like a parachute. It doesn't work if it is not open.�h Frank 
>> Zappa >>
>>
>
>

Reply via email to