public Map<String, BigDecimal> getConversionsForBase(String base) throws FixerException {
    try {
      URI uri = URI.create("https://data.fixer.io/api/latest?access_key=" + apiKey + "&base=" + base);

      HttpResponse<String> response =  client.send(HttpRequest.newBuilder()
                                                              .GET()
                                                              .uri(uri)
                                                              .build(),
                                                   HttpResponse.BodyHandlers.ofString());

      if (response.statusCode() < 200 || response.statusCode() >= 300) {
        throw new FixerException("Bad response: " + response.statusCode() + " " + response.toString());
      }

      FixerResponse parsedResponse = SystemMapper.jsonMapper().readValue(response.body(), FixerResponse.class);

      if (parsedResponse.success) return parsedResponse.rates;
      else                        throw new FixerException("Got failed response!");
    } catch (IOException | InterruptedException e) {
      throw new FixerException(e);
    }
  }
@Test
  public void testGetConversionsForBase() throws IOException, InterruptedException {
    HttpResponse<String> httpResponse = mock(HttpResponse.class);
    when(httpResponse.statusCode()).thenReturn(200);
    when(httpResponse.body()).thenReturn(jsonFixture("fixtures/fixer.res.json"));

    HttpClient httpClient = mock(HttpClient.class);
    when(httpClient.send(any(HttpRequest.class), any(BodyHandler.class))).thenReturn(httpResponse);

    FixerClient fixerClient = new FixerClient(httpClient, "foo");
    Map<String, BigDecimal> conversions = fixerClient.getConversionsForBase("EUR");
    assertThat(conversions.get("CAD")).isEqualTo(new BigDecimal("1.560132"));
  }