Skip to content

Commit

Permalink
a reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed May 17, 2023
1 parent 54e6cb5 commit 58e1846
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,15 @@ public void reserveItems(List<String> ids, Loader<Item[]> loader, Saver<Item> it
@Test
public void testOnlyAvailableItemsAreReserved()
{

Item milk = new Item("M101", "Milk", 2);
Item missing_item = new Item("W202", "Item not Found", 2);
Item sold_out_item = new Item("S303", "SuperPopularGame", 0);

MockSaver<Item> saver = new MockSaver<>();
reserveItems(Arrays.asList(milk.id, missing_item.id, sold_out_item.id ),
() -> new Item[]{milk, sold_out_item},
saver);

reserveItems(Arrays.asList(milk.id, missing_item.id, sold_out_item.id),
() -> new Item[]{milk, sold_out_item}, saver);
// Only reserved milk
Assert.assertArrayEquals(saver.saved.toArray(), new Item[]{milk});
}

// end-snippet
}
public static class InventoryLoader implements Loader<Item[]>
Expand Down

0 comments on commit 58e1846

Please sign in to comment.