Q:

Mockito when is not mocking instead of calling actual method

I am trying to mock for Java class. 
My test class, 
@RunWith(MockitoJunitRunner.class)
public class ATest {

@Test
public void readContent() throws Exception {

Map<String, String> params = new HashMap<>();
params.put("key", "value");

C c = Mockito.mock(C.class);
when(c.methodCall("myString")).thenReturn(params);
String response = A.readParams("anyString");
}
}
public class A{
 private A(){
 }
 public static String readParams(anyString){
 C c = new C();
 Map<String, String> map = c.methodCall("myString");
 return "returnString";
}
}

Here, 
Map<String, String> map = c.methodCall("myString"); 

this line is not mocking. instead of it calls actual method. 
I am using the below jars,

byte-buddy-1.9.5.jar
mockito-core-2.23.4.jar
objenesis-3.0.1.jar

How can I investigate this issue?

A:

The problem is that you are mocking C and inside the readParams method you create a complete new C object and your mocked object is never used. I have modified your method a little bit to address that.
 public static String readParams(C c, String anyString){
 Map<String, String> map = c.methodCall("myString");
 return "returnString";
}

and when you initialize response, you can change to the following code, passing the c that you have mocked.
String response = A.readParams(c, "anyString");

