@Test
public void generateAdUrl_shouldIncludeAllFields() throws Exception {

    final String expectedAdUrl = new AdUrlBuilder(expectedUdid)
            .withAdUnitId("adUnitId")
            .withQuery("key%3Avalue")
            .withLatLon("20.1%2C30.0", "1")
            .withMcc("123")
            .withMnc("456")
            .withCountryIso("expected%20country")
            .withCarrierName("expected%20carrier")
            .withExternalStoragePermission(false)
            .build();
    shadowTelephonyManager.setNetworkOperator("123456");
    shadowTelephonyManager.setNetworkCountryIso("expected country");
    shadowTelephonyManager.setNetworkOperatorName("expected carrier");
    Location location = new Location("");
    location.setLatitude(20.1);
    location.setLongitude(30.0);
    location.setAccuracy(1.23f); // should get rounded to "1"
    String adUrl = subject
            .withAdUnitId("adUnitId")
            .withKeywords("key:value")
            .withLocation(location)
            .generateUrlString("ads.mopub.com");
    assertThat(adUrl).isEqualTo(expectedAdUrl);
}