Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I access the content of a static resource zip file to create several callout mocks?

I'd like to group all service responses in a single zip file without create several static resources. In the docs I find only

MultiStaticResourceCalloutMock multimock = new MultiStaticResourceCalloutMock(); multimock.setStaticResource( '', 'mockResponse'); multimock.setStaticResource( '', 'mockResponse2');

but no mention of static resource zip files.

share|improve this question
I dont think we can zip all in a single file .the main identifier is the name of the static resource .This means we may need separate file names and hence separate static resources for each scenario – Mohith Shrivastava Jan 15 '13 at 11:27

AFAIK its still missing - see unimplemented idea "Apex system delivered class for ZIP file access"

share|improve this answer
Thanks but I think for testing purpose a method like multimock.setStaticResource( '', staticresource('Name-of-zip', 'name-of-file')); would be enough. – Alberto Maianti Jan 15 '13 at 16:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.