### Question:
VSMEventProcessor implements VSMCallback { @Override @Transactional(readOnly = false, propagation = Propagation.REQUIRED) public void onEvent(final VirtualSystemEvent notification) { LOGGER.debug("New notification received, {}.", notification.toString()); VMEventType event = eventFromString(notification.getEventType()); if (stateByEvent.get(event) == null) { LOGGER.error("Unknown event {}. Just ignoring it.", notification.getEventType()); return; } VirtualMachine machine = virtualMachineRep.findByName(notification.getVirtualSystemId()); if (machine != null) { virtualMachineRep.update(updateMachineState(machine, notification)); } } VSMEventProcessor(final EntityManager em);  VSMEventProcessor(); @Override @Transactional(readOnly = false, propagation = Propagation.REQUIRED) void onEvent(final VirtualSystemEvent notification);  }### Answer:
@Test public void test_lockedToOn() { assertStage(createVirtualMachineStage().in(LOCKED).expecting(ON).onEvent(POWER_ON)); assertStage(createVirtualMachineStage().in(LOCKED).expecting(ON).onEvent(RESUMED)); }
@Test public void test_lockedToOff() { assertStage(createVirtualMachineStage().in(LOCKED).expecting(OFF).onEvent(POWER_OFF)); }
@Test(enabled = false) public void test_lockedToNotAllocated() { assertStageAndDestroyed(createVirtualMachineStage().in(LOCKED).expecting(NOT_ALLOCATED) .onEvent(DESTROYED)); }
@Test public void test_lockedToLock() { assertStage(createVirtualMachineStage().in(LOCKED).expecting(LOCKED).onEvent(MOVED)); }
@Test public void test_lockedToPaused() { assertStage(createVirtualMachineStage().in(LOCKED).expecting(PAUSED) .onEvent(VMEventType.PAUSED)); }
@Test public void test_ignoredEvents() { assertStage(createVirtualMachineStage().in(LOCKED).expecting(LOCKED).onEvent(INVALID_EVENT)); assertStage(createVirtualMachineStage().in(LOCKED).expecting(LOCKED).onEvent(CREATED)); assertStage(createVirtualMachineStage().in(LOCKED).expecting(LOCKED).onEvent(SAVED)); assertStage(createVirtualMachineStage().in(LOCKED).expecting(LOCKED).onEvent(UNKNOWN)); }