@Test @PrepareForTest({URL.class, MParticleApiClientImpl.class, MPUtility.class}) public void testFetchConfigFailure() throws Exception { setup(); PowerMockito.mockStatic(MPUtility.class); Mockito.when(MPUtility.hmacSha256Encode(Mockito.anyString(), Mockito.anyString())).thenReturn("encoded"); Mockito.when(mockConnection.getResponseCode()).thenReturn(400); Exception e = null; try { client.fetchConfig(); } catch (MParticleApiClientImpl.MPConfigException cfe) { e = cfe; } assertNotNull(e); }
@Override public void fetchConfig() throws IOException, MPConfigException { fetchConfig(false); }
MParticleApiClientImpl extends MParticleBaseClientImpl implements MParticleApiClient { @Override public void fetchConfig() throws IOException, MPConfigException { fetchConfig(false); } }
MParticleApiClientImpl extends MParticleBaseClientImpl implements MParticleApiClient { @Override public void fetchConfig() throws IOException, MPConfigException { fetchConfig(false); } MParticleApiClientImpl(ConfigManager configManager, SharedPreferences sharedPreferences, Context context); }
MParticleApiClientImpl extends MParticleBaseClientImpl implements MParticleApiClient { @Override public void fetchConfig() throws IOException, MPConfigException { fetchConfig(false); } MParticleApiClientImpl(ConfigManager configManager, SharedPreferences sharedPreferences, Context context); @Override void fetchConfig(); void fetchConfig(boolean force); JSONObject fetchAudiences(); int sendMessageBatch(String message); @Override AliasNetworkResponse sendAliasRequest(String message); void setCookies(JSONObject serverCookies); JSONObject getCookies(); }
MParticleApiClientImpl extends MParticleBaseClientImpl implements MParticleApiClient { @Override public void fetchConfig() throws IOException, MPConfigException { fetchConfig(false); } MParticleApiClientImpl(ConfigManager configManager, SharedPreferences sharedPreferences, Context context); @Override void fetchConfig(); void fetchConfig(boolean force); JSONObject fetchAudiences(); int sendMessageBatch(String message); @Override AliasNetworkResponse sendAliasRequest(String message); void setCookies(JSONObject serverCookies); JSONObject getCookies();  }