高章伟
2022-02-24 2aa8da8af66aa8ae00f25831aed6bb0364176e7b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
@isTest
global class NFM402HttpCallMock implements HttpCalloutMock {
    // 实现这个接口方法
    global HTTPResponse respond(HTTPRequest request) {
        // 创建一个假的回应
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        // response.setBody('{"code":0,"data":[{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"111111"},{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"222222"}],"msg":"执行成功"}');
        response.setBody('{"code":0,"data":[{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"111111","INTERFACE_RECORD_ID":121},{"SYSTEM_SOURCE_REF_NO":"a0J1000000LmVQU","ETQ_UPLOAD_STATUS":"200","ETQ_COMPLAINT_NUMBER":"222222"}],"msg":"执行成功"}');
        
        response.setStatusCode(200);
        return response; 
    }
}