@Test public void retinaByNameTest() throws ApiException { String retinaName = "some_retina_name"; Retina[] retinaArray = { createRetina(retinaName) }; when(api.getRetinas(eq(retinaName))).thenReturn(asList(retinaArray)); Retina retina = retinaInfoApiImpl.retinaByName(retinaName); assertNotNull(retina); verify(api, times(1)).getRetinas(eq(retinaName)); }
@Override public Retina retinaByName(String name) throws ApiException { List<Retina> retinas = api.getRetinas(name); if (retinas == null || retinas.size() == 0) { return null; } return retinas.get(0); }
RetinaInfoApiImpl implements Retinas { @Override public Retina retinaByName(String name) throws ApiException { List<Retina> retinas = api.getRetinas(name); if (retinas == null || retinas.size() == 0) { return null; } return retinas.get(0); } }
RetinaInfoApiImpl implements Retinas { @Override public Retina retinaByName(String name) throws ApiException { List<Retina> retinas = api.getRetinas(name); if (retinas == null || retinas.size() == 0) { return null; } return retinas.get(0); } RetinaInfoApiImpl(final String ip, String apiKey);   RetinaInfoApiImpl(final String ip, final Short port, String apiKey);   RetinaInfoApiImpl(RetinasApi api); }
RetinaInfoApiImpl implements Retinas { @Override public Retina retinaByName(String name) throws ApiException { List<Retina> retinas = api.getRetinas(name); if (retinas == null || retinas.size() == 0) { return null; } return retinas.get(0); } RetinaInfoApiImpl(final String ip, String apiKey);   RetinaInfoApiImpl(final String ip, final Short port, String apiKey);   RetinaInfoApiImpl(RetinasApi api); @Override List<Retina> getAllRetinas(); @Override Retina retinaByName(String name); }
RetinaInfoApiImpl implements Retinas { @Override public Retina retinaByName(String name) throws ApiException { List<Retina> retinas = api.getRetinas(name); if (retinas == null || retinas.size() == 0) { return null; } return retinas.get(0); } RetinaInfoApiImpl(final String ip, String apiKey);   RetinaInfoApiImpl(final String ip, final Short port, String apiKey);   RetinaInfoApiImpl(RetinasApi api); @Override List<Retina> getAllRetinas(); @Override Retina retinaByName(String name);  }