### Question:
SwrveDeeplinkManager { protected void loadCampaign(final String campaignID, final String actionType) { standardParams.put("in_app_campaign_id", campaignID); final ExecutorService executorService = Executors.newSingleThreadExecutor(); try { executorService.execute(SwrveRunnables.withoutExceptions(() -> { try { restClient.get(config.getContentUrl() + SWRVE_AD_CAMPAIGN_URL, standardParams, new IRESTResponseListener() { @Override public void onResponse(RESTResponse response) { if (response.responseCode == HttpURLConnection.HTTP_OK) { try { JSONObject responseJson; try { responseJson = new JSONObject(response.responseBody); } catch (JSONException e) { SwrveLogger.e("SwrveSDK unable to decode ad_journey_campaign JSON : \"%s\".", response.responseBody); throw e; } updateCdnPaths(responseJson); final SwrveAssetsCompleteCallback callback = new SwrveAssetsCompleteCallback() { @Override public void complete() { showCampaign(campaign, context, config); } }; getCampaignAssets(responseJson, callback); writeCampaignDataToCache(responseJson, actionType); } catch (JSONException e) { SwrveLogger.e("Could not parse JSON for ad campaign", e); } } else { SwrveLogger.e("SwrveSDK unable to get ad_journey_campaign JSON : \"%s\".", response.responseBody); loadCampaignFromCache(campaignID); } } @Override public void onException(Exception e) { SwrveLogger.e("Error downloading ad campaign", e); } }); } catch (UnsupportedEncodingException e) { SwrveLogger.e("Could not update ad campaign, invalid parameters", e); } })); } finally { executorService.shutdown(); } } SwrveDeeplinkManager(Map<String, String> standardParams, final SwrveConfig config, final Context context, SwrveAssetsManager swrveAssetsManager, IRESTClient restClient); SwrveMessage getSwrveMessage(); void setSwrveMessage(SwrveMessage swrveMessage); IRESTClient getRestClient(); void setRestClient(IRESTClient restClient); static final String SWRVE_AD_MESSAGE; public SwrveMessageListener swrveMessageListener; public SwrveConversationListener swrveConversationListener; }### Answer:
@Test public void testLoadFromCache() { String campaignData = SwrveTestUtils.getAssetAsText(mActivity, "ad_journey_campaign_message.json"); swrveSpy.multiLayerLocalStorage.getSecondaryStorage().saveOfflineCampaign(swrveSpy.getUserId(), "12345", campaignData); swrveSpy.swrveDeeplinkManager.loadCampaign("12345", null); await().until(campaignShown()); }