Generate %Broadway.Message{} struct to use with unit testing

Hi there, I’m trying to generate a list of broadway messages so that I can test a specific function within my unit tests? I can’t hardcode one as I need the acknowledger to have a PID - However I don’t want to use the Broadway.test_message function to send It through the pipeline, just a list of broadway messages that I can call a specific function with

Thanks! :smiley:

I probably didn’t get the whole picture, but let’s see:

Why not?

A broadway message is just a struct (you know it by the post title), so you can manually create one and pass it to any function, but I guess the point is why? What are you trying to test? Your business logic or Broadway itself?