@Test(timeout = 5000) public void testAuthKeyReadsWithChangedServerId() throws Exception { CachingKeyConfImpl.invalidateCaches(); AtomicInteger callsToGetAuthKeyInfo = new AtomicInteger(0); int expectedCacheHits = 0; doConcurrentAuthKeyReads(callsToGetAuthKeyInfo, UNCHANGED_KEY_CONF, VALID_AUTH_KEY, VALID_SIGNING_INFO, 5, NO_LOOPING, 500); expectedCacheHits++; assertEquals(expectedCacheHits, callsToGetAuthKeyInfo.get()); ServerConf.reload(new EmptyServerConf() { @Override public SecurityServerId getIdentifier() { return SecurityServerId.create("TEST", "CLASS", "CODE2", "SERVER"); } }); doConcurrentAuthKeyReads(callsToGetAuthKeyInfo, UNCHANGED_KEY_CONF, VALID_AUTH_KEY, VALID_SIGNING_INFO, 1, 2, NO_DELAY); expectedCacheHits++; assertEquals(expectedCacheHits, callsToGetAuthKeyInfo.get()); }
protected static void invalidateCaches() { AUTH_KEY_CACHE.invalidateAll(); SIGNING_INFO_CACHE.invalidateAll(); }
CachingKeyConfImpl extends KeyConfImpl { protected static void invalidateCaches() { AUTH_KEY_CACHE.invalidateAll(); SIGNING_INFO_CACHE.invalidateAll(); } }
CachingKeyConfImpl extends KeyConfImpl { protected static void invalidateCaches() { AUTH_KEY_CACHE.invalidateAll(); SIGNING_INFO_CACHE.invalidateAll(); } CachingKeyConfImpl(); }
CachingKeyConfImpl extends KeyConfImpl { protected static void invalidateCaches() { AUTH_KEY_CACHE.invalidateAll(); SIGNING_INFO_CACHE.invalidateAll(); } CachingKeyConfImpl(); @Override SigningCtx getSigningCtx(ClientId clientId); @Override AuthKey getAuthKey(); }
CachingKeyConfImpl extends KeyConfImpl { protected static void invalidateCaches() { AUTH_KEY_CACHE.invalidateAll(); SIGNING_INFO_CACHE.invalidateAll(); } CachingKeyConfImpl(); @Override SigningCtx getSigningCtx(ClientId clientId); @Override AuthKey getAuthKey();  }