@Test public void shouldSetupExpireDate() { item1.setExpireDates("2015-02-15"); item2.setExpireDates("2015-03-15"); item3.setExpireDates("2015-04-15"); stockCard.setStockMovementItemsWrapper(wrapper); stockCardAdapter.setupStockCardExpireDates(stockCard); assertThat(stockCard.getExpireDates(), is(item3.getExpireDates())); }
public void setupStockCardExpireDates(StockCard stockCard) { List<StockMovementItem> wrapper = stockCard.getStockMovementItemsWrapper(); int size = wrapper.size(); if (size > 0) { stockCard.setExpireDates(wrapper.get(size - 1).getExpireDates()); } }
StockCardAdapter implements JsonDeserializer<StockCard> { public void setupStockCardExpireDates(StockCard stockCard) { List<StockMovementItem> wrapper = stockCard.getStockMovementItemsWrapper(); int size = wrapper.size(); if (size > 0) { stockCard.setExpireDates(wrapper.get(size - 1).getExpireDates()); } } }
StockCardAdapter implements JsonDeserializer<StockCard> { public void setupStockCardExpireDates(StockCard stockCard) { List<StockMovementItem> wrapper = stockCard.getStockMovementItemsWrapper(); int size = wrapper.size(); if (size > 0) { stockCard.setExpireDates(wrapper.get(size - 1).getExpireDates()); } } @Inject  StockCardAdapter(); }
StockCardAdapter implements JsonDeserializer<StockCard> { public void setupStockCardExpireDates(StockCard stockCard) { List<StockMovementItem> wrapper = stockCard.getStockMovementItemsWrapper(); int size = wrapper.size(); if (size > 0) { stockCard.setExpireDates(wrapper.get(size - 1).getExpireDates()); } } @Inject  StockCardAdapter(); @Override StockCard deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context); void setupStockCardExpireDates(StockCard stockCard); void setupProductAndStockCardOfMovementItems(StockCard stockCard); }
StockCardAdapter implements JsonDeserializer<StockCard> { public void setupStockCardExpireDates(StockCard stockCard) { List<StockMovementItem> wrapper = stockCard.getStockMovementItemsWrapper(); int size = wrapper.size(); if (size > 0) { stockCard.setExpireDates(wrapper.get(size - 1).getExpireDates()); } } @Inject  StockCardAdapter(); @Override StockCard deserialize(JsonElement json, java.lang.reflect.Type typeOfT, JsonDeserializationContext context); void setupStockCardExpireDates(StockCard stockCard); void setupProductAndStockCardOfMovementItems(StockCard stockCard);  }