@Test(expected = NullPointerException.class) public void givenTheViewIsNotAttached_WhenGetViewIsCalled_ThenAnExceptionIsThrown() { postPresenter.getView(); }
@Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") public PostView getView() { if (postView != null) { return postView; } throw new NullPointerException("PostView reference is null. Have you called attachView()?"); }
PostPresenterImpl implements PostPresenter { @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") public PostView getView() { if (postView != null) { return postView; } throw new NullPointerException("PostView reference is null. Have you called attachView()?"); } }
PostPresenterImpl implements PostPresenter { @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") public PostView getView() { if (postView != null) { return postView; } throw new NullPointerException("PostView reference is null. Have you called attachView()?"); } PostPresenterImpl(final PostModel postModel, final RetrofitService retrofitService, final RxSchedulers rxSchedulers,
                             final InternetAvailabilityDetector internetAvailabilityDetector); }
PostPresenterImpl implements PostPresenter { @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") public PostView getView() { if (postView != null) { return postView; } throw new NullPointerException("PostView reference is null. Have you called attachView()?"); } PostPresenterImpl(final PostModel postModel, final RetrofitService retrofitService, final RxSchedulers rxSchedulers,
                             final InternetAvailabilityDetector internetAvailabilityDetector); @Override void attachView(final PostView postView); @Override boolean isViewAttached(); @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") PostView getView(); @Override void loadPostUserAndPost(final Bundle extras); @Override void detachView(); }
PostPresenterImpl implements PostPresenter { @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") public PostView getView() { if (postView != null) { return postView; } throw new NullPointerException("PostView reference is null. Have you called attachView()?"); } PostPresenterImpl(final PostModel postModel, final RetrofitService retrofitService, final RxSchedulers rxSchedulers,
                             final InternetAvailabilityDetector internetAvailabilityDetector); @Override void attachView(final PostView postView); @Override boolean isViewAttached(); @Override @SuppressWarnings("PMD.AvoidThrowingNullPointerException") PostView getView(); @Override void loadPostUserAndPost(final Bundle extras); @Override void detachView();  }