Hi Balaji, You can write test class two ways- 1)By using static resources-In this you need to go Developer Console-> select File -> New -> Static Resource. 2)By implementing Interface. Create class->then implement interface. Go through this link for more information. https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_rest_callouts#apex_integration_rest_callouts_resources
If you find your Solution then mark this as the best answer.
https://www.thinkaholics.com/salesforce/a-simple-apex-test-class-for-rest-api/
https://blog.jeffdouglas.com/2012/03/21/writing-unit-tests-for-v24-apex-rest-services/
http://www.sfdcstuff.com/2017/08/creating-apex-rest-services-and-testing.html
Check the link for complete detailed explanation: https://newstechnologystuff.com/2020/05/27/test-salesforce-rest-api-using-postman/
You can write test class two ways-
1)By using static resources-In this you need to go
Developer Console-> select File -> New -> Static Resource.
2)By implementing Interface.
Create class->then implement interface.
Go through this link for more information.
https://trailhead.salesforce.com/content/learn/modules/apex_integration_services/apex_integration_rest_callouts#apex_integration_rest_callouts_resources
If you find your Solution then mark this as the best answer.
Thank you!
Regards
Suraj Tripathi