use of com.waz.zclient.core.stores.profile.IProfileStore in project wire-android by wireapp.
the class SingleOtrClientFragmentTest method setupMocksForCurrentOtrClient.
private void setupMocksForCurrentOtrClient(Self mockSelf, Fingerprint mockFingerprint) {
IZMessagingApiStore mockZMessagingApiStore = activity.getStoreFactory().getZMessagingApiStore();
ZMessagingApi mockZMessagingApi = mock(ZMessagingApi.class);
when(mockZMessagingApiStore.getApi()).thenReturn(mockZMessagingApi);
when(mockZMessagingApi.getSelf()).thenReturn(mockSelf);
UiSignal<OtrClient> otrClientUiSignal = MockHelper.mockUiSignal();
when(mockSelf.getOtrClient()).thenReturn(otrClientUiSignal);
final OtrClient mockOtrClient = mock(OtrClient.class);
MockHelper.mockSubscription(otrClientUiSignal, mockOtrClient);
UiSignal<Fingerprint> fingerprintUiSignal = MockHelper.mockUiSignal();
when(mockOtrClient.getFingerprint()).thenReturn(fingerprintUiSignal);
MockHelper.mockSubscription(fingerprintUiSignal, mockFingerprint);
when(mockFingerprint.getRawBytes()).thenReturn(DEFAULT_FINGERPRINT.getBytes());
// Not really needed, as user is not used for current device
IProfileStore mockProfileStore = activity.getStoreFactory().getProfileStore();
User mockUser = mock(User.class);
when(mockProfileStore.getSelfUser()).thenReturn(mockUser);
}
Aggregations