@Override
    protected Rate getRate(final String key) {
        Rate rate = null;
        GetValue value = this.consulClient.getKVValue(buildValidConsulKey(key)).getValue();
        if (value != null && value.getDecodedValue() != null) {
            try {
                rate = this.objectMapper.readValue(value.getDecodedValue(), Rate.class);
            } catch (IOException e) {
                log.error("Failed to deserialize Rate", e);
            }
        }
        return rate;
    }
@Test
    public void testGetRateException() throws IOException {
        GetValue getValue = new GetValue();
        getValue.setValue("");
        when(consulClient.getKVValue(any())).thenReturn(new Response<>(getValue, 1L, true, 1L));
        when(objectMapper.readValue(anyString(), eq(Rate.class))).thenAnswer(invocation -> {
            throw new IOException();
        });
        ConsulRateLimiter consulRateLimiter = new ConsulRateLimiter(rateLimiterErrorHandler, consulClient, objectMapper);

        Rate rate = consulRateLimiter.getRate("");
        assertThat(rate).isNull();
    }