@Test public void shouldNotGetPhoneValueWhenNoPhoneOrPrimaryPhoneAvailable() { final ImmutableList<ImmutableMap<String, String>> testList = ImmutableList.of(ImmutableMap.of("type", "mobile", "value", "8457943879438")); String actualPhone = ContactUsRecordUtils.getPhoneValue(testList.toArray()); assertNull(actualPhone); }
@Test public void shouldGetPhoneValueWhenPhoneAvailable() { final String expectedPhone = "094583048502"; final ImmutableList<ImmutableMap<String, String>> testList = ImmutableList.of( ImmutableMap.of("type", "phone", "value", expectedPhone), ImmutableMap.of("type", "mobile", "value", "8457943879438")); String actualPhone = ContactUsRecordUtils.getPhoneValue(testList.toArray()); assertNotNull(actualPhone); assertEquals(actualPhone, expectedPhone); }