-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: Add consumer error event tests
- Loading branch information
1 parent
ba50742
commit 9ecd1ca
Showing
2 changed files
with
121 additions
and
27 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
src/KafkaFlow.IntegrationTests/Core/Middlewares/TriggerErrorMessageMiddleware.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using KafkaFlow.IntegrationTests.Core.Handlers; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace KafkaFlow.IntegrationTests.Core.Middlewares | ||
{ | ||
internal class TriggerErrorMessageMiddleware : IMessageMiddleware | ||
{ | ||
public async Task Invoke(IMessageContext context, MiddlewareDelegate next) | ||
{ | ||
MessageStorage.Add((byte[])context.Message.Value); | ||
throw new Exception(); | ||
Check warning on line 15 in src/KafkaFlow.IntegrationTests/Core/Middlewares/TriggerErrorMessageMiddleware.cs Codacy Production / Codacy Static Code Analysissrc/KafkaFlow.IntegrationTests/Core/Middlewares/TriggerErrorMessageMiddleware.cs#L15
|
||
await next(context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters