@SuppressWarnings({"rawtypes", "unchecked"})

@Test
public void testExecuteWithGlobalLockSet() throws Exception {
    //initial objects
    ConnectionProxy connectionProxy = new ConnectionProxy(null, null);
    StatementProxy statementProxy = new StatementProxy<>(connectionProxy, null);
    BaseTransactionalExecutor<Object, Statement> baseTransactionalExecutor
            = new BaseTransactionalExecutor<Object, Statement>(statementProxy, null, null) {
        @Override
        protected Object doExecute(Object... args) {
            return null;
        }
    };
    GlobalLockTemplate<Object> globalLockLocalTransactionalTemplate = new GlobalLockTemplate<>();
    // not in global lock context
    ((Callable<Object>) () -> {
        try {
            baseTransactionalExecutor.execute(new Object());
            Assertions.assertTrue(!connectionProxy.isGlobalLockRequire(), "conectionContext set!");
        } catch (Throwable e) {
            throw new RuntimeException(e);
        }
        return null;
    }).call();
    //in global lock context
    globalLockLocalTransactionalTemplate.execute(new Callable<Object>() {
        @Override
        public Object call() throws Exception {
            try {
                baseTransactionalExecutor.execute(new Object());
                Assertions.assertTrue(connectionProxy.isGlobalLockRequire(), "conectionContext not set!");
            } catch (Throwable e) {
                throw new RuntimeException(e);
            }
            return null;
        }
    });
}