VirgilCardClient implements CardClient { public Tuple<RawSignedModel, Boolean> getCard(String cardId, String token) throws VirgilServiceException { try { URL url = new URL(serviceUrl, cardId); return new Tuple<>(httpClient.execute(url, "GET", token, null, RawSignedModel.class), false); } catch (VirgilCardIsOutdatedException e) { LOGGER.fine("Outdated Card is received"); return new Tuple<>(e.getCardModel(), true); } catch (VirgilServiceException e) { LOGGER.log(Level.SEVERE, "Some service issue occurred during request executing", e); throw e; } catch (Exception e) { LOGGER.log(Level.SEVERE, "Some issue occurred during request executing", e); throw new VirgilCardServiceException(e); } } VirgilCardClient();  VirgilCardClient(HttpClient httpClient);  VirgilCardClient(String serviceUrl);  VirgilCardClient(String serviceUrl, HttpClient httpClient);  VirgilCardClient(URL serviceUrl);  VirgilCardClient(URL serviceUrl, HttpClient httpClient); Tuple<RawSignedModel, Boolean> getCard(String cardId, String token); @Override List<String> getOutdated(Collection<String> cardIds, String token); HttpClient getHttpClient(); URL getServiceUrl(); RawSignedModel publishCard(RawSignedModel rawCard, String token); List<RawSignedModel> searchCards(String identity, String token); List<RawSignedModel> searchCards(Collection<String> identities, String token); void revokeCard(String cardId, String token); void setHttpClient(HttpClient httpClient);  }
@Test public void stc_25_get() throws CryptoException { try { cardClient.getCard(Generator.cardId(), "Try our fried tokens"); fail(); } catch (VirgilServiceException e) { assertEquals(HttpURLConnection.HTTP_BAD_REQUEST, e.getHttpError().getCode()); assertEquals(20303, e.getErrorCode()); } }