gpt-3.5-turbo-0301· OpenAI
WildChat-4.8M (AI2)
write a test class for the below code public void execute(QueueableContext context) {…
- User
write a test class for the below code public void execute(QueueableContext context) { HttpRequest reqPayment = new HttpRequest(); reqPayment.setEndpoint(paymentCenterConfig.Zuora_Endpoint__c+'/v1/payments/'+paymentId+'/apply'); System.debug('endpoint'+reqPayment.getEndpoint()); reqPayment.setMethod('PUT'); reqPayment.setHeader('Content-Type', 'application/json'); reqPayment.setHeader('Accept', 'application/json'); InvoiceWrapper invWrapper = new InvoiceWrapper(invoiceId,paymentAmount); Map < String, Object > paymnt = new Map < String, Object >();
paymnt.put('invoices', new List<InvoiceWrapper>{invWrapper}); paymnt.put('effectiveDate', invoiceTargetDate); String payloadPayment = JSON.serialize(paymnt); System.debug('quoteInvoicePayload'+payloadPayment); reqPayment.setBody(payloadPayment); System.debug(reqPayment); HttpResponse respPayment; if(!Test.isRunningTest()) { respPayment = zApi.sendRequest(reqPayment); }else{ Http h = new Http(); respPayment = h.send(reqPayment); } System.debug('quoteinvoiceApplyPaymentResponse'+respPayment); System.debug('quoteinvoiceApplyPaymentResponse'+respPayment.getBody()); System.debug('quoteinvoiceApplyPaymentResponse'+respPayment.getStatusCode());}
- Assistant