How do you write a test class for WS?



How do you write a test class for WS?..

Answer / Pushp Kumar Deval

To write a test class for Apex Web Services (AWS) in Salesforce, you should create a TestClass that extends the WebServiceTest class and contains methods annotated with @Test. Inside these methods, you can call your AWS classes, set up required data, and check the expected results using assertions. You may also need to mock external services or HTTP calls using MockHttpResponse or Test.setMockHttpResponse() methods.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Salesforce Interview Questions

What creative solutions have you come up with to navigate around a governor limit?

1 Answers  


If an action is scheduled to be executed for a time-based workflow, is it possible to delete the workflow?

1 Answers  


What are the permission sets in salesforce?

1 Answers  


What is lightning: or ui: in any lightning component?

1 Answers  


Can we bind an existing Apex Controller with a lightning component?

1 Answers  


What are local and global ids with respect to lightning component?

1 Answers  


What is the lookup relationship?

1 Answers  


What is a custom report type? : salesforce reports and dashboards

1 Answers  


If user does not have any right on particular record and have only read level access at object level. Can he change the record owner?

1 Answers  


What are the different ways to store various types of records in salesforce?

1 Answers  


Explain Approval Terminology?

1 Answers  


What are record types?

1 Answers  


Categories