Skip to main content
deleted 338 characters in body
Source Link
Reshma
  • 4.1k
  • 7
  • 29
  • 43

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
}

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;
    System.assertEquals(actualValue, expectedValue);
    System.assertEquals(200, res.getStatusCode());
}

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());

    facebook_API.getpermission('test');

    //Assert what you are doing after getting response
}
Source Link
Reshma
  • 4.1k
  • 7
  • 29
  • 43

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;
    System.assertEquals(actualValue, expectedValue);
    System.assertEquals(200, res.getStatusCode());
}