diff --git a/finish/inventory/src/main/java/io/openliberty/guides/inventory/InventoryQueueListener.java b/finish/inventory/src/main/java/io/openliberty/guides/inventory/InventoryQueueListener.java index 7d519c0..ea46c67 100644 --- a/finish/inventory/src/main/java/io/openliberty/guides/inventory/InventoryQueueListener.java +++ b/finish/inventory/src/main/java/io/openliberty/guides/inventory/InventoryQueueListener.java @@ -1,3 +1,14 @@ +// tag::copyright[] +/******************************************************************************* + * Copyright (c) 2024 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + *******************************************************************************/ +// end::copyright[] package io.openliberty.guides.inventory; import io.openliberty.guides.models.SystemLoad; diff --git a/finish/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryEndpointIT.java b/finish/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryEndpointIT.java index 6c1a976..c9ce4a4 100644 --- a/finish/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryEndpointIT.java +++ b/finish/inventory/src/test/java/it/io/openliberty/guides/inventory/InventoryEndpointIT.java @@ -28,7 +28,11 @@ import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestMethodOrder; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertEquals; + @TestMethodOrder(MethodOrderer.OrderAnnotation.class) public class InventoryEndpointIT { @@ -71,11 +75,14 @@ public void testNonEmpty() { boolean hostnameExists = false; boolean loadAverageExists = false; for (int n = 0; n < systems.size(); n++) { - hostnameExists = systems.getJsonObject(n).get("hostname").toString().isEmpty(); - loadAverageExists = systems.getJsonObject(n).get("systemLoad").toString().isEmpty(); + hostnameExists = systems.getJsonObject(n).get("hostname") + .toString().isEmpty(); + loadAverageExists = systems.getJsonObject(n).get("systemLoad") + .toString().isEmpty(); assertFalse(hostnameExists, "A host was registered, but it was empty"); - assertFalse(loadAverageExists, "A load average was registered, but it was empty"); + assertFalse(loadAverageExists, + "A load average was registered, but it was empty"); if (!hostnameExists && !loadAverageExists) { String host = systems.getJsonObject(n).get("hostname").toString(); hostname = host.substring(1, host.length() - 1); @@ -93,7 +100,8 @@ public void testNonEmpty() { public void testValue() { assertNotNull(hostname, "Hostname should be set by the first test."); - Response response = this.getResponse(baseUrl + INVENTORY_SYSTEMS + "/" + hostname); + Response response = this.getResponse(baseUrl + + INVENTORY_SYSTEMS + "/" + hostname); this.assertResponse(baseUrl, response); JsonObject system = response.readEntity(JsonObject.class); @@ -101,7 +109,8 @@ public void testValue() { String responseHostname = system.getString("hostname"); Boolean loadAverageExists = system.get("systemLoad").toString().isEmpty(); - assertEquals(hostname, responseHostname, "Hostname should match the one from the TestNonEmpty"); + assertEquals(hostname, responseHostname, + "Hostname should match the one from the TestNonEmpty"); assertFalse(loadAverageExists, "A Load Average should not be empty"); response.close();