my $test = $helper->run_test({ # wraps methods get_ok, post_ok etc from Test::Mojo uri => $some_endpoint, # what we are testing status => 201, # expected status of call to our API method => 'post', # HTTP method of the request data => $json_args, # what the user would pass in the call to our API override => [{ method => 'get', # HTTP method of the first mocked external call status => 200, # mocked return status of the first mocked call content => $some_data, # mocked response content from the first mocked call }, { method => 'post', # HTTP method of the second mocked external call status => 201, # mocked return status of the second mocked call content => $other_data, # mocked response content from the second mocked call }], }); $test->json_is('/result/foo', 'bar'); # Test::Mojo methods used to test the response