Im am trying to get the URL of one of my PageReferences whenever i call its method to return it to me i get this result URL:[delegate:{MY RELATIVE URL}]. Anyone know if why it's returning this, Please no hacks trying to parse this string. I will note that the redirect bit is set to true in case that has anything to do with it. I am looking for an explanation, or perhaps something that I'm missing or doing wrong.
/* Cancel and Return to previous screen */
public PageReference cancel(){
this.retUrl = retUrl.setRedirect(true);
return this.retUrl;
}
.... Test Class
PageReference prCancel = controller.cancel();
//Test the redirects
Test.setCurrentPage( new PageReference(Url.getSalesforceBaseURL() + prCancel.getURL()) );
string currentPageURLString = Url.getSalesforceBaseURL() + ApexPages.currentPage().getURL();
string lookingForURL = Url.getSalesforceBaseUrl().toExternalForm() + '/'+controller.opportunityClone.Id+'/';
== LOG OUPUT ==
10:09:10:739 USER_DEBUG [204]|DEBUG|Url:[delegate=https://cs30.salesforce.com]/006n00000082U10AAE/