Box for Salesforce Developer Toolkit - how to write test methods

Highlighted
New Contributor

Box for Salesforce Developer Toolkit - how to write test methods

I've written apex code that customizes the folder structure on box and of course, in order to deploy it I need to write test methods. Writing standard @istest methods I receive the errors that no root folder is set up so I mocked up data and put the custom settings for the root folder in my test method. However I still get the "Most recent error: Unable to create folder for Salesforce record because the root folder was not found/created." Can someone please help to point into the right direction? Is there maybe a mock version of the toolkit that I should be using in the tests? What is the standard approach here? I have not found any docs.

 

Any help is very much appreciated!

 

(For more details, please have a look here)

 

Many thanks!

Tags (2)
2 REPLIES 2
Box Employee

Re: Box for Salesforce Developer Toolkit - how to write test methods

Hi @sniemz,

 

Just to follow up, unfortunately there are no standard tests / mock versions that I am aware of, and the extent of the integration documentation is available on the developer site. The extent of what I found was something like this, but I don't believe that gets you what you need. I'll ask around and see if we can surface additional potential integrations / guidance.

 

- Jon

Highlighted
New Contributor

Re: Box for Salesforce Developer Toolkit - how to write test methods

Hi Jon, yes please, that would be great. Examples would be enough.

I am using the function box.Toolkit.createFolder(); extensively and it seems like that even during test runs the method is trying to create folders which surprises me. So a good way to get around that would be great!