4

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.

CamJohnson26
  • 1,119
  • 1
  • 15
  • 40
  • What I've decided to do is just stop using exceptions and instead set my payload and http status directly in the flow. Not ideal but at least it works with munit – CamJohnson26 May 25 '16 at 19:40

1 Answers1

7

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

clare
  • 526
  • 7
  • 14