AdConfiguration implements Serializable { String getDeviceLocale() { return mDeviceLocale; } @VisibleForTesting  AdConfiguration(final Context context); static AdConfiguration extractFromMap(Map<String, Object> map); @VisibleForTesting void setResponseString(String responseString); long getBroadcastIdentifier();  }
@Test public void constructor_shouldSetDeviceLocale() throws Exception { Robolectric.getShadowApplication().getResources().getConfiguration().locale = Locale.FRANCE; subject = new AdConfiguration(context); assertThat(subject.getDeviceLocale()).isEqualTo("fr_FR"); }
@Test public void constructor_withNullContext_shouldNotSetDeviceLocale() throws Exception { Robolectric.getShadowApplication().getResources().getConfiguration().locale = Locale.FRANCE; subject = new AdConfiguration(null); assertThat(subject.getDeviceLocale()).isNull(); }