예제 #1
0
  @Test
  public void events() {
    List<Entitlement> ents = new ArrayList<Entitlement>();
    ents.add(mock(Entitlement.class));
    ents.add(mock(Entitlement.class));

    Event evt1 = mock(Event.class);
    Event evt2 = mock(Event.class);
    when(ef.entitlementCreated(any(Entitlement.class))).thenReturn(evt1).thenReturn(evt2);
    entitler.sendEvents(ents);

    verify(sink).queueEvent(eq(evt1));
    verify(sink).queueEvent(eq(evt2));
  }
예제 #2
0
 @Test
 public void noEventsWhenListEmpty() {
   List<Entitlement> ents = new ArrayList<Entitlement>();
   entitler.sendEvents(ents);
   verify(sink, never()).queueEvent(any(Event.class));
 }
예제 #3
0
 @Test
 public void noEventsWhenEntitlementsNull() {
   entitler.sendEvents(null);
   verify(sink, never()).queueEvent(any(Event.class));
 }