@Test public void shouldRefreshUIWhenInvokeOnActivityResultWithRNRListRequestCode() throws Exception { rnRFormListActivity.onActivityResult(Constants.REQUEST_FROM_RNR_LIST_PAGE, Activity.RESULT_OK, new Intent()); verify(mockedPresenter, times(2)).loadRnRFormList(); }
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) { return; } switch (requestCode) { case Constants.REQUEST_FROM_RNR_LIST_PAGE: loadForms(); break; case Constants.REQUEST_SELECT_PERIOD_END: Date periodEndDate = (Date) data.getSerializableExtra(Constants.PARAM_SELECTED_INVENTORY_DATE); boolean isMissedPeriod = data.getBooleanExtra(Constants.PARAM_IS_MISSED_PERIOD, false); createRequisition(periodEndDate, isMissedPeriod); break; } }
RnRFormListActivity extends BaseReportListActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) { return; } switch (requestCode) { case Constants.REQUEST_FROM_RNR_LIST_PAGE: loadForms(); break; case Constants.REQUEST_SELECT_PERIOD_END: Date periodEndDate = (Date) data.getSerializableExtra(Constants.PARAM_SELECTED_INVENTORY_DATE); boolean isMissedPeriod = data.getBooleanExtra(Constants.PARAM_IS_MISSED_PERIOD, false); createRequisition(periodEndDate, isMissedPeriod); break; } } }
RnRFormListActivity extends BaseReportListActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) { return; } switch (requestCode) { case Constants.REQUEST_FROM_RNR_LIST_PAGE: loadForms(); break; case Constants.REQUEST_SELECT_PERIOD_END: Date periodEndDate = (Date) data.getSerializableExtra(Constants.PARAM_SELECTED_INVENTORY_DATE); boolean isMissedPeriod = data.getBooleanExtra(Constants.PARAM_IS_MISSED_PERIOD, false); createRequisition(periodEndDate, isMissedPeriod); break; } }  }
RnRFormListActivity extends BaseReportListActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) { return; } switch (requestCode) { case Constants.REQUEST_FROM_RNR_LIST_PAGE: loadForms(); break; case Constants.REQUEST_SELECT_PERIOD_END: Date periodEndDate = (Date) data.getSerializableExtra(Constants.PARAM_SELECTED_INVENTORY_DATE); boolean isMissedPeriod = data.getBooleanExtra(Constants.PARAM_IS_MISSED_PERIOD, false); createRequisition(periodEndDate, isMissedPeriod); break; } }  static Intent getIntentToMe(Context context, Constants.Program programCode); @Override void onActivityResult(int requestCode, int resultCode, Intent data); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); }
RnRFormListActivity extends BaseReportListActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode != Activity.RESULT_OK) { return; } switch (requestCode) { case Constants.REQUEST_FROM_RNR_LIST_PAGE: loadForms(); break; case Constants.REQUEST_SELECT_PERIOD_END: Date periodEndDate = (Date) data.getSerializableExtra(Constants.PARAM_SELECTED_INVENTORY_DATE); boolean isMissedPeriod = data.getBooleanExtra(Constants.PARAM_IS_MISSED_PERIOD, false); createRequisition(periodEndDate, isMissedPeriod); break; } }  static Intent getIntentToMe(Context context, Constants.Program programCode); @Override void onActivityResult(int requestCode, int resultCode, Intent data); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); static final int DEFAULT_FORM_ID_OF_NOT_AUTHORIZED; }