@Test public void onCreate_withCachedCustomer_showsUi() { Customer customer = Customer.fromString(CustomerSessionTest.FIRST_TEST_CUSTOMER_OBJECT); when(mCustomerSessionProxy.getCachedCustomer()).thenReturn(customer); mActivityController.get().initializeCustomerSourceData(); assertNotNull(mProgressBar); assertNotNull(mRecyclerView); assertNotNull(mAddCardView); assertEquals(View.VISIBLE, mAddCardView.getVisibility()); assertEquals(View.VISIBLE, mRecyclerView.getVisibility()); assertEquals(View.GONE, mProgressBar.getVisibility()); }
@VisibleForTesting void initializeCustomerSourceData() { Customer cachedCustomer = mCustomerSessionProxy == null ? CustomerSession.getInstance().getCachedCustomer() : mCustomerSessionProxy.getCachedCustomer(); if (cachedCustomer != null) { mCustomer = cachedCustomer; createListFromCustomerSources(); } else { getCustomerFromSession(); } }
PaymentMethodsActivity extends AppCompatActivity { @VisibleForTesting void initializeCustomerSourceData() { Customer cachedCustomer = mCustomerSessionProxy == null ? CustomerSession.getInstance().getCachedCustomer() : mCustomerSessionProxy.getCachedCustomer(); if (cachedCustomer != null) { mCustomer = cachedCustomer; createListFromCustomerSources(); } else { getCustomerFromSession(); } } }
PaymentMethodsActivity extends AppCompatActivity { @VisibleForTesting void initializeCustomerSourceData() { Customer cachedCustomer = mCustomerSessionProxy == null ? CustomerSession.getInstance().getCachedCustomer() : mCustomerSessionProxy.getCachedCustomer(); if (cachedCustomer != null) { mCustomer = cachedCustomer; createListFromCustomerSources(); } else { getCustomerFromSession(); } }  }
PaymentMethodsActivity extends AppCompatActivity { @VisibleForTesting void initializeCustomerSourceData() { Customer cachedCustomer = mCustomerSessionProxy == null ? CustomerSession.getInstance().getCachedCustomer() : mCustomerSessionProxy.getCachedCustomer(); if (cachedCustomer != null) { mCustomer = cachedCustomer; createListFromCustomerSources(); } else { getCustomerFromSession(); } }  static Intent newIntent(Context context); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); }
PaymentMethodsActivity extends AppCompatActivity { @VisibleForTesting void initializeCustomerSourceData() { Customer cachedCustomer = mCustomerSessionProxy == null ? CustomerSession.getInstance().getCachedCustomer() : mCustomerSessionProxy.getCachedCustomer(); if (cachedCustomer != null) { mCustomer = cachedCustomer; createListFromCustomerSources(); } else { getCustomerFromSession(); } }  static Intent newIntent(Context context); @Override boolean onPrepareOptionsMenu(Menu menu); @Override boolean onCreateOptionsMenu(Menu menu); @Override boolean onOptionsItemSelected(MenuItem item); static final String EXTRA_SELECTED_PAYMENT; }