malthe commented on code in PR #7076:
URL: https://github.com/apache/nifi/pull/7076#discussion_r1206301347
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/test/java/org/apache/nifi/processors/azure/eventhub/TestConsumeAzureEventHub.java:
##########
@@ -117,13 +131,22 @@ public class TestConsumeAzureEventHub {
@Mock
RecordReader reader;
+ @Mock
+ CheckpointStore checkpointStore;
+
+ @Mock
+ BlobContainerAsyncClient blobContainerAsyncClient;
+
+ @Captor
+ private ArgumentCaptor<Consumer<EventBatchContext>>
eventBatchProcessorCapture;
+
private MockConsumeAzureEventHub processor;
private TestRunner testRunner;
@BeforeEach
public void setupProcessor() {
- processor = new MockConsumeAzureEventHub();
+ processor = spy(new MockConsumeAzureEventHub());
Review Comment:
Previously, the processor wasn't tested through the `onTrigger` but through
some internal methods.
I changed the tests so that all testing happens through the actually exposed
interface. However, this requires some additional mocking in order to implement
the checkpoint strategy for example.
(The reason being, we don't have the luxury of testing against a real event
hub here.)
But instead of spying on the processor, I suppose I could implement some
alternative methods on the mock class. I don't remember if I tried that and
faced some issues perhaps.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]