EntitiesList implements IsWidget { public void clear() { callback = null; paginationConstraints = null; totalPages = -1; emptyEntitiesText = null; view.clear(); } @Inject  EntitiesList(LoadingBox loadingBox,
                        View view); void show(final AbstractEntityManager.SearchResponse<T> response,
                     final Callback<T> callback); void select(final String identifier); void unselect(final String identifier); void clear(); void setPageSize(int pageSize); void setEmptyEntitiesText(String emptyEntitiesText); void setEntityTitleSize(HeadingSize headingSize); @Override Widget asWidget(); public View view; }
@Test public void testClear() throws Exception { presenter.callback = mock(EntitiesList.Callback.class); presenter.paginationConstraints = mock(EntitiesList.PaginationConstraints.class); presenter.totalPages = 10; presenter.emptyEntitiesText = "empty"; presenter.clear(); assertNull(presenter.callback); assertNull(presenter.paginationConstraints); assertEquals(presenter.totalPages, -1); assertNull(presenter.emptyEntitiesText); verify(view, times(0)).configure(anyString(), any(EntitiesList.PaginationConstraints.class)); verify(view, times(0)).add(anyInt(), anyString(), anyString(), any(HeadingSize.class), anyBoolean(), anyBoolean(), anyBoolean(), anyBoolean()); verify(view, times(1)).clear(); }