Complete the code to create a mock server in Postman.
pm.mockServer.create({ url: '[1]' });The mock server URL should point to the mock endpoint, which is usually different from live or stub URLs.
Complete the code to stub a response in Postman test script.
pm.stubResponse({ status: [1] });Stubbing a response with status 200 simulates a successful API call.
Fix the error in the mock server creation code.
pm.mockServer.create({ url: '[1]' }); // URL must be a stringThe URL must be a string without extra quotes inside the string literal.
Fill both blanks to stub a JSON response with status 200.
pm.stubResponse({ status: [1], body: [2] });Status 200 means success, and the body should be a JSON string representing the response.
Fill all three blanks to create a mock server, set a stub response, and verify the status code.
const mock = pm.mockServer.create({ url: '[1]' });
pm.stubResponse({ status: [2] });
pm.test('Status code is [3]', () => {
pm.expect(pm.response.code).to.eql([2]);
});The mock server URL should be the mock URL, the stub response status 200 means success, and the test verifies the status code matches 200.