I have 2 class A and B. A has code for Http Callout and from B we are calling A's class method which has callout code. So should we write mock test class for A only or do we have to write mock test for both the classes?
You only need to create single mock for Class A and then when you run your unit test for class B when it comes to HTTP Callout part in class A it will do that mock.
1) Class B calls method from Class A with Callout 2) When test comes to HTTP Callout it will implement the mock 3) Unit test continues as usual.
I hope this helps you.