### Question:
Aggregator { @RequestMapping(path = "/product", method = RequestMethod.GET) public Product getProduct() { var product = new Product(); var productTitle = informationClient.getProductTitle(); var productInventory = inventoryClient.getProductInventories(); product.setTitle(requireNonNullElse(productTitle, "Error: Fetching Product Title Failed")); product.setProductInventories(requireNonNullElse(productInventory, -1)); return product; }  @RequestMapping(path = "/product", method = RequestMethod.GET) Product getProduct();  }### Answer:
@Test public void testGetProduct() { var title = "The Product Title."; var inventories = 5; when(informationClient.getProductTitle()).thenReturn(title); when(inventoryClient.getProductInventories()).thenReturn(inventories); var testProduct = aggregator.getProduct(); assertEquals(title, testProduct.getTitle()); assertEquals(inventories, testProduct.getProductInventories()); }