@Test
public void verifyThatKeyIsNotCachedIfResponseDoesNotContainKeyId()
        throws InterruptedException, ExecutionException, TimeoutException {

    mockSuccessfulDiscoveryEndpointRequest();
    mockSuccessfulPublicKeysRequestWithoutMatchingKeyId();
    assertThat(underTest.getPublicKey("google.com", KEY_ID).get(LATCH_TIMEOUT, TimeUnit.SECONDS)).isEmpty();
    verify(httpClientMock).createSingleHttpRequest(DISCOVERY_ENDPOINT_REQUEST);
    verify(httpClientMock).createSingleHttpRequest(PUBLIC_KEYS_REQUEST);
    Mockito.clearInvocations(httpClientMock);
    assertThat(underTest.getPublicKey("google.com", KEY_ID).get(LATCH_TIMEOUT, TimeUnit.SECONDS)).isEmpty();
    verify(httpClientMock).createSingleHttpRequest(DISCOVERY_ENDPOINT_REQUEST);
    verify(httpClientMock).createSingleHttpRequest(PUBLIC_KEYS_REQUEST);
}