Can you try this test method in your test class. You need to call method getpermission
instead of getpermissionresponse
. It will cover both the methods.
@isTest static void testgetpermission() {
Test.setMock(HttpCalloutMock.class, new MockHttpResponseGeneratorforpermission());
HttpResponse res = facebook_API.getpermission('test');
// Verify response received contains fake values
String contentType = res.getHeader('Content-Type');
System.assert(contentType == 'application/json');
String actualValue = res.getBody();
String expectedValue = json;
Assert System.assertEquals(actualValue,what expectedValue);
you are doing after System.assertEquals(200,getting res.getStatusCode());response
}