congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ContactsLocalGateway.obtainContacts
Code IndexAdd Tabnine to your IDE (free)

How to use
obtainContacts
method
in
me.panavtec.cleancontacts.domain.model.ContactsLocalGateway

Best Java code snippets using me.panavtec.cleancontacts.domain.model.ContactsLocalGateway.obtainContacts (Showing top 7 results out of 315)

origin: PaNaVTEC/Clean-Contacts

 @Override public List<Contact> obtain() {
  return localGateway.obtainContacts();
 }
};
origin: PaNaVTEC/Clean-Contacts

@Test public void hit_network_when_local_is_empty() {
 when(localGateway.obtainContacts()).thenReturn(EMPTY_LIST);
 interactor.call();
 verify(networkGateway).obtainContacts();
}
origin: PaNaVTEC/Clean-Contacts

@Test public void update_cache_when_hit_network() throws Exception {
 when(localGateway.obtainContacts()).thenReturn(EMPTY_LIST);
 when(networkGateway.obtainContacts()).thenReturn(CONTACTS);
 interactor.call();
 verify(localGateway).persist(CONTACTS);
}
origin: PaNaVTEC/Clean-Contacts

@Test public void return_local_contacts_when_local_storage_is_populated() {
 when(localGateway.obtainContacts()).thenReturn(CONTACTS);
 InteractorResponse<List<Contact>> response = interactor.call();
 assertThatResponseHasResult(response);
}
origin: PaNaVTEC/Clean-Contacts

@Test public void return_networks_contacts_when_network_success() {
 when(localGateway.obtainContacts()).thenReturn(EMPTY_LIST);
 when(networkGateway.obtainContacts()).thenReturn(CONTACTS);
 InteractorResponse<List<Contact>> response = interactor.call();
 assertThatResponseHasResult(response);
}
origin: PaNaVTEC/Clean-Contacts

@Test public void hit_network_when_local_fails() {
 when(localGateway.obtainContacts()).thenThrow(new LocalException());
 interactor.call();
 verify(networkGateway).obtainContacts();
}
origin: PaNaVTEC/Clean-Contacts

@Test public void return_an_error_when_network_fails() {
 when(localGateway.obtainContacts()).thenReturn(EMPTY_LIST);
 when(networkGateway.obtainContacts()).thenThrow(new NetworkException());
 InteractorResponse<List<Contact>> result = interactor.call();
 assertThatResponseHasError(result);
}
me.panavtec.cleancontacts.domain.modelContactsLocalGatewayobtainContacts

Popular methods of ContactsLocalGateway

  • persist
  • obtain

Popular in Java

  • Finding current android device location
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (Timer)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now