It appears that my Dev org's custom settings are not available within the scope of a unit test so I've written code to insert the needed custom setting within the test.
I have a callout method which I need to test that accesses the custom setting. When the method executes it throws an exception informing me that I may not execute DML prior to the callout. Since the callout method needs access to the custom setting prior to making the callout I'm presented with a bit of a problem.
In this case, the callout method is checking the custom setting for a token expiration datetime. If the value of the token's datetime has already elapsed, the callout isn't made, instead the token value is taken from the custom setting. But if the datetime's value has already elapsed the callout is made for a fresh token/token expiration datetime and the custom setting is updated.
So how can this callout method be properly tested given the above DML limitation? I'm also using a MultiStaticResourceCalloutMock for the callout response, but the code never gets far enough along to use it before encountering the exception.
Any ideas on how to resolve the issue or perhaps a workaround to avoid it entirely?