public void test_supplyPassphrase_delegates_to_stub() throws RemoteException { wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); OpenVpnPassphrase param = new OpenVpnPassphrase("p"); wrapper.supplyPassphrase(param); Mockito.verify(openVpnServiceStub).supplyPassphrase(param); }
public void test_supplyPassphrase_RemoteException_disables_binding() throws RemoteException { Mockito.doThrow(new RemoteException()) .when(openVpnServiceStub) .supplyPassphrase(Mockito.any(OpenVpnPassphrase.class)); wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); wrapper.supplyPassphrase(new OpenVpnPassphrase("p")); assertFalse(wrapper.isBound()); }