Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assert exception thrown in MUnit, Mulesoft

Is there a way to assert that a flow reference threw an exception in Mulesoft? Searching Google and the documentation isn't turning up anything.

Basically I'm testing a subflow that throws a NotFound exception if a certain item exists, but MUnit fails when it receives the error, even though it's expected.

I know I could mock my validator and have it return specific data which I then check for, but I was hoping there's something native that can do this that's less hacky.

like image 844
CamJohnson26 Avatar asked Sep 17 '25 06:09

CamJohnson26


1 Answers

I think what you're looking for is the 'expectException' attribute on the test itself. HTH.

like image 112
clare Avatar answered Sep 19 '25 19:09

clare