* #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices * #984 Fix for abstract-document, abstract-factory, acyclic-visitor, adapter, aggregator-microservices
This commit is contained in:
@ -50,7 +50,7 @@ public class Aggregator {
|
||||
*/
|
||||
@RequestMapping(path = "/product", method = RequestMethod.GET)
|
||||
public Product getProduct() {
|
||||
Product product = new Product();
|
||||
var product = new Product();
|
||||
product.setTitle(informationClient.getProductTitle());
|
||||
product.setProductInventories(inventoryClient.getProductInventories());
|
||||
return product;
|
||||
|
@ -43,10 +43,10 @@ public class ProductInformationClientImpl implements ProductInformationClient {
|
||||
@Override
|
||||
public String getProductTitle() {
|
||||
String response = null;
|
||||
HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51515/information")).build();
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
var request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51515/information")).build();
|
||||
var client = HttpClient.newHttpClient();
|
||||
try {
|
||||
HttpResponse<String> httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
response = httpResponse.body();
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.error("IOException Occurred", ioe);
|
||||
|
@ -42,12 +42,12 @@ public class ProductInventoryClientImpl implements ProductInventoryClient {
|
||||
|
||||
@Override
|
||||
public int getProductInventories() {
|
||||
String response = "0";
|
||||
var response = "0";
|
||||
|
||||
HttpRequest request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51516/inventories")).build();
|
||||
HttpClient client = HttpClient.newHttpClient();
|
||||
var request = HttpRequest.newBuilder().GET().uri(URI.create("http://localhost:51516/inventories")).build();
|
||||
var client = HttpClient.newHttpClient();
|
||||
try {
|
||||
HttpResponse<String> httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
var httpResponse = client.send(request, HttpResponse.BodyHandlers.ofString());
|
||||
response = httpResponse.body();
|
||||
} catch (IOException ioe) {
|
||||
LOGGER.error("IOException Occurred", ioe);
|
||||
|
Reference in New Issue
Block a user