public void test_getStatus_RemoteException_returns_stopped() throws RemoteException { Mockito.when(openVpnServiceStub.getStatus()).thenThrow(new RemoteException()); wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); OpenVpnState status = wrapper.getStatus(); assertFalse(status.isStarted()); }
public void test_getStatus_RemoteException_disables_binding() throws RemoteException { Mockito.when(openVpnServiceStub.getStatus()).thenThrow(new RemoteException()); wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); wrapper.getStatus(); assertFalse(wrapper.isBound()); }
public void test_getStatusFor_RemoteException_returns_stopped() throws RemoteException { OpenVpnConfig config = new OpenVpnConfig(new File("/dev/null")); Mockito.when(openVpnServiceStub.getStatusFor(config)).thenThrow(new RemoteException()); wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); OpenVpnState status = wrapper.getStatusFor(config); assertFalse(status.isStarted()); }
public void test_getStatusFor_RemoteException_disables_binding() throws RemoteException { OpenVpnConfig config = new OpenVpnConfig(new File("/dev/null")); Mockito.when(openVpnServiceStub.getStatusFor(config)).thenThrow(new RemoteException()); wrapper.onServiceConnected(COMPONENT_NAME, openVpnServiceStub); wrapper.getStatusFor(config); assertFalse(wrapper.isBound()); }
private void resetOpenVpnServiceStub() { reset(openVpnServiceStub); Mockito.when(openVpnServiceStub.queryLocalInterface(Mockito.anyString())) .thenReturn(openVpnServiceStub); }