LockManager lm = tl.lm;
Fqn fqn = Fqn.fromString("/a/b/c");
NodeSPI node = createNode(fqn);
InvocationContext ctx = tl.icc.get();
ctx.setGlobalTransaction(new GlobalTransaction());
ctx.setTransaction(new DummyTransaction(DummyTransactionManager.getInstance()));
ctx.setTransactionContext(tl.contextFactory.createTransactionContext(ctx.getTransaction()));
// lock and record.
lm.lockAndRecord(node, WRITE, ctx);
assert ctx.getLocks().contains(fqnBasedLocking ? fqn : node.getLock());