@Test
public void testCreateEventItemStateEventUnDefType() throws Exception {

    Event event = factory.createEvent(ITEM_STATE_EVENT_TYPE, ITEM_STATE_EVENT_TOPIC, ITEM_UNDEF_STATE_EVENT_PAYLOAD,
            SOURCE);
    assertEquals(ItemStateEvent.class, event.getClass());
    ItemStateEvent itemStateEvent = (ItemStateEvent) event;
    assertEquals(ITEM_STATE_EVENT_TYPE, itemStateEvent.getType());
    assertEquals(ITEM_STATE_EVENT_TOPIC, itemStateEvent.getTopic());
    assertEquals(ITEM_UNDEF_STATE_EVENT_PAYLOAD, itemStateEvent.getPayload());
    assertEquals(ITEM_NAME, itemStateEvent.getItemName());
    assertEquals(SOURCE, itemStateEvent.getSource());
    assertEquals(UnDefType.UNDEF, itemStateEvent.getItemState());
}