@Test public void testGetProductDesktop() { String imagePath = "/product-image.png"; String price = "20"; when(imageClient.getImagePath()).thenReturn(imagePath); when(priceClient.getPrice()).thenReturn(price); DesktopProduct desktopProduct = apiGateway.getProductDesktop(); assertEquals(price, desktopProduct.getPrice()); assertEquals(imagePath, desktopProduct.getImagePath()); }
@RequestMapping("/desktop") public DesktopProduct getProductDesktop() { DesktopProduct desktopProduct = new DesktopProduct(); desktopProduct.setImagePath(imageClient.getImagePath()); desktopProduct.setPrice(priceClient.getPrice()); return desktopProduct; }
ApiGateway { @RequestMapping("/desktop") public DesktopProduct getProductDesktop() { DesktopProduct desktopProduct = new DesktopProduct(); desktopProduct.setImagePath(imageClient.getImagePath()); desktopProduct.setPrice(priceClient.getPrice()); return desktopProduct; } }
ApiGateway { @RequestMapping("/desktop") public DesktopProduct getProductDesktop() { DesktopProduct desktopProduct = new DesktopProduct(); desktopProduct.setImagePath(imageClient.getImagePath()); desktopProduct.setPrice(priceClient.getPrice()); return desktopProduct; }  }
ApiGateway { @RequestMapping("/desktop") public DesktopProduct getProductDesktop() { DesktopProduct desktopProduct = new DesktopProduct(); desktopProduct.setImagePath(imageClient.getImagePath()); desktopProduct.setPrice(priceClient.getPrice()); return desktopProduct; }  @RequestMapping("/desktop") DesktopProduct getProductDesktop(); @RequestMapping("/mobile") MobileProduct getProductMobile(); }
ApiGateway { @RequestMapping("/desktop") public DesktopProduct getProductDesktop() { DesktopProduct desktopProduct = new DesktopProduct(); desktopProduct.setImagePath(imageClient.getImagePath()); desktopProduct.setPrice(priceClient.getPrice()); return desktopProduct; }  @RequestMapping("/desktop") DesktopProduct getProductDesktop(); @RequestMapping("/mobile") MobileProduct getProductMobile();  }