Salesforce Certified MuleSoft Platform Integration Architect Practice Questions

Salesforce Certified MuleSoft Platform Integration Architect exam preparation

Salesforce Certified MuleSoft Platform Integration Architect practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

Salesforce Certified MuleSoft Platform Integration Architect free question 6 / 10 · Domain 5: Designing automated tests for Mule applications

A flow under test calls a partner HTTP service through an HTTP request operation. The unit test must not reach the partner and should return a fixed payload instead. Which MUnit element fits?

  1. The Mock When processor, which returns a configured response instead of the real operation
  2. The Before Test scope, which starts the partner service on a local port for the test
  3. The Verify Call processor, which checks that the HTTP request ran a number of times
  4. The Spy processor, which runs the real operation and records what it receives
Show the answer and explanation

Answer: A

Why this is correct
The Mock When processor intercepts a specified event processor during an MUnit test and returns a configured response instead of executing the real operation. Its purpose is to isolate the flow under test from external dependencies such as HTTP requests, database calls or web service operations. The processor attribute names what to mock, with-attribute narrows the match, for example to the POST method, and then-return supplies the payload, which can also come from a DataWeave file. Spies and verification help to observe behavior, but only Mock When replaces the call.

Why the other options are wrong
"The Spy processor, which runs the real operation and records what it receives" … A spy observes calls around the real operation. The page describes Mock When as the element that replaces the real operation with a configured response.
"The Verify Call processor, which checks that the HTTP request ran a number of times" … Verify Call checks how often a processor was invoked. It does not return a configured response.
"The Before Test scope, which starts the partner service on a local port for the test" … A Before Test scope runs setup logic. The page describes no local start of the partner service for isolation.

Key points
Mock When replaces an external call with a configured response so that the unit test stays isolated.

Go to the Salesforce Certified MuleSoft Platform Integration Architect practice app (10 free questions; purchase unlocks all questions)

See the full practice set