Esempio n. 1
0
  @Test
  public void bindByPool() throws EntitlementRefusedException {
    String poolid = "pool10";
    Pool pool = mock(Pool.class);
    Entitlement ent = mock(Entitlement.class);
    List<Entitlement> eList = new ArrayList<Entitlement>();
    eList.add(ent);

    when(pm.find(eq(poolid))).thenReturn(pool);
    Map<String, Integer> pQs = new HashMap<String, Integer>();
    pQs.put(poolid, 1);
    when(pm.entitleByPools(eq(consumer), eq(pQs))).thenReturn(eList);

    List<Entitlement> ents = entitler.bindByPoolQuantity(consumer, poolid, 1);
    assertNotNull(ents);
    assertEquals(ent, ents.get(0));
  }