49 / 81 · Module 14 — External Automated Testing of Mule Integrations · filtered: interview← prev⊞ allnext →
14.10Test structure
A clean API integration test might look like:
test('customer is mapped to Salesforce Account', async ({ request }) => {
// Arrange
const customer = makeCustomer();
// Act
const response = await createCustomer(request, customer);
// Assert API
expect(response.status()).toBe(201);
// Assert target system
const account =
await salesforce.findAccount(customer.customerId);
expect(account.Name).toBe(customer.companyName);
expect(account.Phone).toBe(customer.phone);
});
This is simple and strong.