Testing Storm Bolts and Spouts

后端 未结 4 1092
天命终不由人
天命终不由人 2020-12-23 00:05

This is a general question regarding Unit Testing Bolts and Spouts in a Storm Topology written in Java.

What is the recommended practice and guideline for un

4条回答
  •  庸人自扰
    2020-12-23 00:09

    It turns out to be fairly easy to mock storm objects like OutputDeclarer, Tuple and OutputFieldsDeclarer. Of those, only OutputDeclarer ever sees any side effects so code the OutputDeclarer mock class to be able to answer any tuples and anchors emitted, for example. Your test class can then use instances of those mock classes to easily configure a bolt/spout instance, invoke it and validate the expected side effects.

提交回复
热议问题