when(node.getName()).thenReturn(nodeName);
InteractionProtocol protocol = _zk.getInteractionProtocol();
NodeQueue nodeQueue = protocol.publishNode(node, new NodeMetaData());
NodeOperation nodeOperation1 = mock(NodeOperation.class, withSettings().serializable().name("a"));
NodeOperation nodeOperation2 = mock(NodeOperation.class, withSettings().serializable().name("b"));
OperationId operation1Id = protocol.addNodeOperation(nodeName, nodeOperation1);
OperationId operation2Id = protocol.addNodeOperation(nodeName, nodeOperation2);
assertTrue(protocol.isNodeOperationQueued(operation1Id));
assertTrue(protocol.isNodeOperationQueued(operation2Id));
assertEquals(nodeOperation1.toString(), nodeQueue.remove().toString());
assertEquals(nodeOperation2.toString(), nodeQueue.remove().toString());
assertTrue(nodeQueue.isEmpty());
assertFalse(protocol.isNodeOperationQueued(operation1Id));
assertFalse(protocol.isNodeOperationQueued(operation2Id));
}