While your question is about how to view code coverage in the developer console, the underlying issue preventing your deployment is pretty clear.
I don't need to see your code, or know which lines are covered to say that the issue preventing your deployment is that you've wrapped your callout code in an if
block that prevents it from running when you're running unit tests. (Thanks for including that information, by the way. It was very helpful in determining the root cause of the issue that led you to ask this question).
It is true that we can't make callouts during a unit test, but wrapping a good portion of your callout code (the code which sends the request to the external system, and handles the response) in an if(!Test.isRunningTest())
isn't really the right way to go about this.
Code that isn't run during tests is not covered.
To get coverage for your callout code, you'll need to mock the callout by creating another class that implements the HTTPCalloutMock interface. What this does is it intercepts the callout request in your test, and returns an HttpResponse
instance that you define.
You can add the @isTest
annotation to the class that implements HttpCalloutMock
so that the mock implemenation doesn't require coverage itself.
I haven't tested this myself, but you may be able to simply use an inner class, defined inside of your existing test class, to keep things a little more tidy. An example would be
@isTest
public class myTestClass{
public class testMock implements HttpCalloutMock{
public HttpResponse respond(HttpRequest req){
// define your pre-programmed response here
}
}
static testMethod void myTest(){
Test.setMock(HttpCalloutMock.class, new testMock());
// rest of your test
}
}