use of com.waz.api.OtrClient in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParametersAndClickVerify_shouldUpdateOtrClient.
@Test
public void launchFragmentWithParametersAndClickVerify_shouldUpdateOtrClient() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
when(mockOtrClient.getVerified()).thenReturn(Verification.UNVERIFIED);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
onView(otrSwitchWithId(R.id.os__single_otr_client__verify)).perform(click());
verify(mockOtrClient).setVerified(true);
}
use of com.waz.api.OtrClient in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParametersAndClickShowMyFingerprint_shouldCallController.
@Test
public void launchFragmentWithParametersAndClickShowMyFingerprint_shouldCallController() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
when(mockOtrClient.getVerified()).thenReturn(Verification.UNVERIFIED);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
onView(withId(R.id.ttv__single_otr_client__my_fingerprint)).perform(click());
verify(activity.getControllerFactory().getConversationScreenController()).showCurrentOtrClient();
}
use of com.waz.api.OtrClient in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParametersAndClickResetSession_shouldCallOtrClientResetSession.
//@Test
// Pending AN-XXX
public void launchFragmentWithParametersAndClickResetSession_shouldCallOtrClientResetSession() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
when(mockOtrClient.getVerified()).thenReturn(Verification.UNVERIFIED);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
onView(withId(R.id.ttv__single_otr_client__reset)).perform(click());
verify(mockOtrClient).resetSession(any(OtrClient.ResetCallback.class));
}
use of com.waz.api.OtrClient in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method launchFragmentWithParameters_shouldDisplayDisplayNameInText.
@Test
public void launchFragmentWithParameters_shouldDisplayDisplayNameInText() {
User mockUser = mock(User.class);
OtrClient mockOtrClient = mock(OtrClient.class);
setupMocksForOtherOtrClient(mockUser, mockOtrClient);
attachFragment(SingleOtrClientFragment.newInstance(mockOtrClient, mockUser), SingleOtrClientFragment.TAG);
String text = activity.getString(R.string.otr__participant__single_device__description, DEFAULT_DISPLAY_NAME);
onView(withId(R.id.ttv__single_otr_client__description)).check(hasText(text));
}
use of com.waz.api.OtrClient in project wire-android by wireapp.
the class DevicesPreferences method updateOtrDevices.
private void updateOtrDevices() {
PreferenceGroup otherOtrClientPreferenceGroup = (PreferenceGroup) findPreference(getString(R.string.pref_devices_other_devices_category_key));
if (otherOtrClientPreferenceGroup == null) {
return;
}
otherOtrClientPreferenceGroup.removeAll();
if (otherClients == null) {
return;
}
for (int i = 0; i < otherClients.size(); i++) {
OtrClient otrClient = otherClients.get(i);
addClientToGroup(otrClient, otherOtrClientPreferenceGroup);
}
if (otherClients.size() > 0) {
addDeviceWarning(otherOtrClientPreferenceGroup);
otherOtrClientPreferenceGroup.setTitle(getString(R.string.pref_devices_other_devices_category_title));
} else {
otherOtrClientPreferenceGroup.setTitle("");
}
}
Aggregations