Tests for commands and events

Change-Id: If625272ca9ab372b188e5f790be1991c1e773eb1