@Test
public void listevents() {
when(ec.listAll()).thenReturn(null);
EventResource er = new EventResource(ec, null,
injector.getInstance(EventAdapter.class));
assertNull(er.listEvents());
List<Event> events = new ArrayList<Event>();
events.add(getEvent());
when(ec.listAll()).thenReturn(events);
assertEquals(events, er.listEvents());