OfferLifecycleManager { public void markAsConsumed(Protos.Offer offer) { ConsumedOffer consumedOffer = consumedOfferMap.get(offer.getHostname()); if (consumedOffer == null) { consumedOffer = new ConsumedOffer(); consumedOfferMap.put(offer.getHostname(), consumedOffer); } consumedOffer.add(offer); } @Inject  OfferLifecycleManager(NodeStore nodeStore, MyriadDriver myriadDriver); void declineOffer(Protos.Offer offer); void addOffers(Protos.Offer... offers); void markAsConsumed(Protos.Offer offer); ConsumedOffer drainConsumedOffer(String hostname); void declineOutstandingOffers(String hostname);  }
@Test public void testMarkAsConsumed() throws Exception { Offer offer = TestObjectFactory.getOffer("localhost-1", "slave-2", "mock-framework", "consumed-offer-1", 1.0, 1024.0); manager.addOffers(offer); manager.markAsConsumed(offer); ConsumedOffer cOffers = manager.getConsumedOffer("localhost-1"); Offer cOffer = cOffers.getOffers().get(0); assertEquals(offer, cOffer); }