@Test(expected = CustomException.class)
public void stubMethodException() throws Exception {

    User user = new User(mockWebService, USER_ID, PASSWORD);
    when(mockWebService.isNetworkOffline()).thenThrow(CustomException.class);
    user.login(mockLoginInterface);
}