DataSetSummary implements IsWidget { public void show(final DataSetDef def) { if (def != null) { final boolean isShowBackendCache = def.getProvider() != null && ( !DataSetProviderType.BEAN.equals(def.getProvider()) && !DataSetProviderType.CSV.equals(def.getProvider() )); final Boolean isCacheEnabled = isShowBackendCache ? def.isCacheEnabled() : null; final boolean isPushEnabled = def.isPushEnabled(); final boolean isRefreshEnabled = def.getRefreshTime() != null; view.showStatusPanel(isCacheEnabled, isPushEnabled, isRefreshEnabled); showLoadingIcon(); getMetadata(def, new DataSetMetadataCallback() { @Override public void callback(final DataSetMetadata metadata) { final int estimatedSize = metadata.getEstimatedSize(); final int rowCount = metadata.getNumberOfRows(); view.showSizePanel(humanReadableRowCount(rowCount) + " " + DataSetExplorerConstants.INSTANCE.rows(), humanReadableByteCount(estimatedSize)); } @Override public void notFound() { showErrorIcon(); showError(def.getUUID(), DataSetExplorerConstants.INSTANCE.notFound()); } @Override public boolean onError(final ClientRuntimeError error) { showErrorIcon(); showError(def.getUUID(), error); return false; } }); } } @Inject  DataSetSummary(final DataSetClientServices clientServices, 
                          final Event<ErrorEvent> errorEvent, 
                          final View view); @PostConstruct void init(); @Override Widget asWidget(); void show(final DataSetDef def);  }
@Test public void testShow() throws Exception { final int estimatedSize = 100; final int rowCount = 10; when(dataSetMetadata.getEstimatedSize()).thenReturn(estimatedSize); when(dataSetMetadata.getNumberOfRows()).thenReturn(rowCount); presenter.show(dataSetDef); verify(view, times(0)).init(presenter); verify(view, times(1)).showStatusPanel(true, true, true); verify(view, times(1)).showSizePanelIcon(any(IconType.class), anyString(), anyString(), anyBoolean()); verify(view, times(1)).showSizePanel(anyString(), anyString()); }