### Question:
InventoryController { @RequestMapping(value = "/inventories", method = RequestMethod.GET) public int getProductInventories() { return 5; }  @RequestMapping(value = "/inventories", method = RequestMethod.GET) int getProductInventories();  }### Answer:
@Test public void testGetProductInventories() { InventoryController inventoryController = new InventoryController(); int numberOfInventories = inventoryController.getProductInventories(); assertEquals(5, numberOfInventories); }
@Test public void testGetProductInventories() { var inventoryController = new InventoryController(); var numberOfInventories = inventoryController.getProductInventories(); assertEquals(5, numberOfInventories); }
@Test public void testGetProductInventories() throws Exception { InventoryController inventoryController = new InventoryController(); int numberOfInventories = inventoryController.getProductInventories(); assertEquals(5, numberOfInventories); }