EntitiesList implements IsWidget { public void show(final AbstractEntityManager.SearchResponse<T> response, final Callback<T> callback) { if (callback != null && response != null) { show(response.getResults(), createPaginationCallback(response), callback); } } @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 testShow() throws Exception { final int size = 10; List<User> users = buildUsersList(size); final boolean hasNextPage = false; final int page = 1; final int pageSize = 50; final AbstractEntityManager.SearchResponse<User> searchResponse = createSearchResponse(users, size, hasNextPage, "", page, pageSize); final EntitiesList.Callback<User> callback = createEntitiesListCallback(users, true, true, true); presenter.show(searchResponse, callback); assertEquals(presenter.callback, callback); verify(view, times(0)).clear(); verify(loadingBox, times(1)).show(); verify(view, times(1)).configure(anyString(), any(EntitiesList.PaginationConstraints.class)); for (int x = 0; x < size; x++) { verify(view, times(1)).add(x, getUserIdentifier(x), getUserIdentifier(x), headingSize, true, true, true, false); } verify(loadingBox, times(1)).hide(); }