@Test public void testResumeScanningOnResponse() throws Exception { final SearchResult searchResult = SearchUtil.createSearchResult(1); presenter.onResponse(null, Response.success(searchResult)); verify(viewBinder).resumeScanning(); }
@Override public void onResponse(Call<SearchResult> call, Response<SearchResult> response) { final SearchResult searchResult = response.body(); currentSearchResult = searchResult; logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty", "company_received", String.valueOf(searchResult.product_id), (searchResult.code != null) ? searchResult.code : "empty", sessionId.get()); productList.addProduct(searchResult); viewBinder.resumeScanning(); viewBinder.setSupportPolaAppButtonVisibility(searchResult.askForSupport(), searchResult); }
MainPresenter implements Callback<SearchResult>, BarcodeListener { @Override public void onResponse(Call<SearchResult> call, Response<SearchResult> response) { final SearchResult searchResult = response.body(); currentSearchResult = searchResult; logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty", "company_received", String.valueOf(searchResult.product_id), (searchResult.code != null) ? searchResult.code : "empty", sessionId.get()); productList.addProduct(searchResult); viewBinder.resumeScanning(); viewBinder.setSupportPolaAppButtonVisibility(searchResult.askForSupport(), searchResult); } }
MainPresenter implements Callback<SearchResult>, BarcodeListener { @Override public void onResponse(Call<SearchResult> call, Response<SearchResult> response) { final SearchResult searchResult = response.body(); currentSearchResult = searchResult; logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty", "company_received", String.valueOf(searchResult.product_id), (searchResult.code != null) ? searchResult.code : "empty", sessionId.get()); productList.addProduct(searchResult); viewBinder.resumeScanning(); viewBinder.setSupportPolaAppButtonVisibility(searchResult.askForSupport(), searchResult); } MainPresenter(@NonNull MainViewBinder viewBinder,
                  @NonNull ProductList productList,
                  @NonNull Api api,
                  @NonNull EventLogger logger,
                  @NonNull SessionId sessionId,
                  @NonNull Bus eventBus); }
MainPresenter implements Callback<SearchResult>, BarcodeListener { @Override public void onResponse(Call<SearchResult> call, Response<SearchResult> response) { final SearchResult searchResult = response.body(); currentSearchResult = searchResult; logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty", "company_received", String.valueOf(searchResult.product_id), (searchResult.code != null) ? searchResult.code : "empty", sessionId.get()); productList.addProduct(searchResult); viewBinder.resumeScanning(); viewBinder.setSupportPolaAppButtonVisibility(searchResult.askForSupport(), searchResult); } MainPresenter(@NonNull MainViewBinder viewBinder,
                  @NonNull ProductList productList,
                  @NonNull Api api,
                  @NonNull EventLogger logger,
                  @NonNull SessionId sessionId,
                  @NonNull Bus eventBus); static MainPresenter create(Context applicationContext, @NonNull final MainViewBinder viewBinder,
                                       @NonNull final ProductList productList,
                                       @NonNull final ProductsAdapter productsAdapter,
                                       @NonNull SessionId sessionId,
                                       @NonNull final Bus eventBus); @Override void onBarcode(String barcode, boolean fromCamera); @Override void onResponse(Call<SearchResult> call, Response<SearchResult> response); @Override void onFailure(Call<SearchResult> call, Throwable t); @Subscribe @SuppressWarnings("WeakerAccess") void productDetailsFragmentDismissed(@SuppressWarnings("UnusedParameters") ProductDetailsFragmentDismissedEvent event); @Subscribe @SuppressWarnings("WeakerAccess") void reportButtonClicked(ReportButtonClickedEvent event); void setCurrentSearchResult(SearchResult currentSearchResult); void onBackStackChange(boolean isNotBackStackEmpty); void onSupportPolaButtonClick(); void onSupportPolaFinished(); }
MainPresenter implements Callback<SearchResult>, BarcodeListener { @Override public void onResponse(Call<SearchResult> call, Response<SearchResult> response) { final SearchResult searchResult = response.body(); currentSearchResult = searchResult; logger.logContentView((searchResult.name != null) ? searchResult.name + "" : "empty", "company_received", String.valueOf(searchResult.product_id), (searchResult.code != null) ? searchResult.code : "empty", sessionId.get()); productList.addProduct(searchResult); viewBinder.resumeScanning(); viewBinder.setSupportPolaAppButtonVisibility(searchResult.askForSupport(), searchResult); } MainPresenter(@NonNull MainViewBinder viewBinder,
                  @NonNull ProductList productList,
                  @NonNull Api api,
                  @NonNull EventLogger logger,
                  @NonNull SessionId sessionId,
                  @NonNull Bus eventBus); static MainPresenter create(Context applicationContext, @NonNull final MainViewBinder viewBinder,
                                       @NonNull final ProductList productList,
                                       @NonNull final ProductsAdapter productsAdapter,
                                       @NonNull SessionId sessionId,
                                       @NonNull final Bus eventBus); @Override void onBarcode(String barcode, boolean fromCamera); @Override void onResponse(Call<SearchResult> call, Response<SearchResult> response); @Override void onFailure(Call<SearchResult> call, Throwable t); @Subscribe @SuppressWarnings("WeakerAccess") void productDetailsFragmentDismissed(@SuppressWarnings("UnusedParameters") ProductDetailsFragmentDismissedEvent event); @Subscribe @SuppressWarnings("WeakerAccess") void reportButtonClicked(ReportButtonClickedEvent event); void setCurrentSearchResult(SearchResult currentSearchResult); void onBackStackChange(boolean isNotBackStackEmpty); void onSupportPolaButtonClick(); void onSupportPolaFinished();  }