@Override
    protected void saveRate(Rate rate) {
        String value = "";
        try {
            value = this.objectMapper.writeValueAsString(rate);
        } catch (JsonProcessingException e) {
            log.error("Failed to serialize Rate", e);
        }

        if (hasText(value)) {
            this.consulClient.setKVValue(buildValidConsulKey(rate.getKey()), value);
        }
    }
@Test
    public void testSaveRateException() throws IOException {
        JsonProcessingException jsonProcessingException = Mockito.mock(JsonProcessingException.class);
        when(objectMapper.writeValueAsString(any())).thenThrow(jsonProcessingException);
        ConsulRateLimiter consulRateLimiter = new ConsulRateLimiter(rateLimiterErrorHandler, consulClient, objectMapper);

        consulRateLimiter.saveRate(null);
        verifyNoInteractions(consulClient);
    }