salesforce - How to access a VF page's content during unit tests -


i need test multiple call-outs return xml. storing xml inside unit tests' mock class not great solution.

i'm wondering if there's salesforce object type paste xml accessible during unit tests. know pagereference's getcontent() doesn't during unit tests (bummer).

of course, of apex allowed line-breaks inside string literals easier cut , paste xml, alas...

store xml in static resource, , query staticresource object test code:

staticresource sr = [select body staticresource name='test_xml' limit 1]; string xmlstring = string.valueof(sr.body); dom.document doc = new dom.document(); doc.load(testxml); 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -