@Test
    public void shouldCheckCacheForCredentials() throws IOException {
      final AuthToken user = new OpenStackToken(authResponse);
      byte[] userInfoBytes = ObjectSerializer.instance().writeObject(user);
      when(authService.validateToken(anyString(), anyString())).thenReturn(user);

      final FilterDirector director = handlerWithCache.handleRequest(request, response);

      verify(store).get(eq(AUTH_TOKEN_CACHE_PREFIX + "." + user.getTokenId()));
      assertEquals(
          "Auth component must pass valid requests", FilterAction.PASS, director.getFilterAction());
    }
    @Override
    public void run() {
      try {
        while (total < finishTotal) {
          try {
            Thread.sleep(sleepDuration);
          } catch (InterruptedException ie) {
            break;
          }

          final CacheableValue myValue = datastore.get(myKey).elementAs(CacheableValue.class);
          datastore.put(
              myKey,
              ObjectSerializer.instance().writeObject(myValue.next()),
              300,
              TimeUnit.SECONDS);

          total++;
        }
      } catch (Exception ex) {
        ex.printStackTrace();
      }
    }