If I understand correctly, you would like to see an integration test that confirms the transactional nature of batches used by a source or sink, in the context of a file channel. Is that right? So some test cases might be:
Part 1: Testing transaction nature of source and file channel
1. Configure the file channel with a capacity of 10 events, a source, and no sink (we're staging the file channel with events here).
2. The source sends 9 events to the file channel
3. The source then sends batch request to put 2 events into FC.
The expectations are:
1. The batch request sent by the source (containing the 2 events) should fail. For this test, ensure that the source does not attempt to retry the request.
2. The channel at this point should contain only 9 events.
1. Reconfigure the agent so that the source is removed, and a sink is added.
2. The sink takes all events from the file channel.
The expectations for the sink are:
1. The sink receives only 9 events
2. Those events are the same events that were sent by the source (same payload, same headers)
3. Those events arrive in the same order as how the source sent them to the file channel.
Part 2: Testing transaction nature of file channel and sink
Briefly, the test could be to set the FC's capacity to 10 events, stage the file channel with 2 events, then have the sink attempt to send those 2 events in a batch but fail. This should result in the file channel still containing those same 2 events, in the same order. One way to verify this might be to setup 2 sinks in a failover group, where the 2 events are first sent to sink#1 (higher priority), which should fail and cause sink#2 to receive those same events and put them into a file (eg, using FILE_ROLL sink) so that the number of events, event payload, and event ordering can be verified in the file that's written-out by sink#2.
Please let me know if this is what you had in mind. If so, I can open a separate ticket for these tests.