Refactor peer command tests