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

How do you change vbulletin's home page to the forums instead of the default (CMS or Activity Stream)? -

c++ - Troubles when compiling phash program -