1 package android.telephony; 2 3 import static com.google.common.truth.Truth.assertThat; 4 5 import androidx.test.ext.junit.runners.AndroidJUnit4; 6 import org.junit.Test; 7 import org.junit.runner.RunWith; 8 9 /** 10 * Tests that Robolectric's android.telephony.PhoneNumberUtils support is consistent with device. 11 */ 12 @RunWith(AndroidJUnit4.class) 13 public class PhoneNumberUtilsTest { 14 // This test requires the libphonenumber metadata in the Android SDK. 15 @Test formatNumber()16 public void formatNumber() { 17 String number1 = "+16501230003"; 18 assertThat(PhoneNumberUtils.formatNumber(number1, "us")).isEqualTo("+1 650-123-0003"); 19 } 20 } 21