public void testValidationOnlyInPrimaryOwner() throws Exception { final Object key = new MagicKey(cache(1), cache(0)); final DataContainer primaryOwnerDataContainer = TestingUtil.extractComponent(cache(1), InternalDataContainer.class); final DataContainer backupOwnerDataContainer = TestingUtil.extractComponent(cache(0), InternalDataContainer.class); final VersionGenerator versionGenerator = TestingUtil.extractComponent(cache(1), VersionGenerator.class); injectReorderResponseRpcManager(cache(3), cache(0)); cache(1).put(key, 1); for (Cache cache : caches()) { assertEquals("Wrong initial value for cache " + address(cache), 1, cache.get(key)); ControllerInboundInvocationHandler handler = wrapInboundInvocationHandler(cache(0), ControllerInboundInvocationHandler::new); BackupOwnerInterceptor backupOwnerInterceptor = injectBackupOwnerInterceptor(cache(0)); backupOwnerInterceptor.blockCommit(true); handler.discardRemoteGet = true; assertEquals("Wrong value for tx1.", 1, cache(2).get(key)); cache(2).put(key, 2); tm(2).commit(); return Boolean.TRUE; Integer value = (Integer) cache(3).get(key); return value != null && value == 2; }); assertEquals("Wrong value for tx2.", 2, cache(3).get(key)); cache(3).put(key, 3); tm(3).commit(); return Boolean.TRUE;