diff --git a/helidon-storefront-full/.classpath b/helidon-storefront-full/.classpath index 77be441..36b1772 100644 --- a/helidon-storefront-full/.classpath +++ b/helidon-storefront-full/.classpath @@ -24,8 +24,9 @@ - + + diff --git a/helidon-storefront-full/pom.xml b/helidon-storefront-full/pom.xml index f42845e..3dcbf85 100644 --- a/helidon-storefront-full/pom.xml +++ b/helidon-storefront-full/pom.xml @@ -1,4 +1,5 @@ + - - + 4.0.0 - - - io.helidon.applications - helidon-mp - 3.1.2 - - + + io.helidon.applications + helidon-mp + 4.0.2 + + + com.oracle.labs.helidon.storefront.Main - 17 + 21 ${maven.compiler.source} - 1.18.26 + 1.18.36 3.3.1 + 3.1.2 true - ghcr.io/graalvm/graalvm-ce:ol9-java17-22.3.1 + ghcr.io/graalvm/jdk-community:21 com.oracle.labs.helidon storefront - ${project.parent.version} - ${project.artifactId} - io.helidon.microprofile.bundles helidon-microprofile - org.jboss + io.helidon.microprofile.bundles + helidon-microprofile-core + + + io.helidon.microprofile.openapi + helidon-microprofile-openapi + + + io.helidon.microprofile.health + helidon-microprofile-health + + + jakarta.json.bind + jakarta.json.bind-api + + + org.glassfish.jersey.media + jersey-media-json-binding + runtime + + + io.helidon.logging + helidon-logging-jul + runtime + + + io.smallrye jandex runtime - true jakarta.activation jakarta.activation-api - runtime + + + org.eclipse.microprofile.metrics + microprofile-metrics-api + + + io.helidon.microprofile.metrics + helidon-microprofile-metrics org.junit.jupiter junit-jupiter-api test - + + + io.helidon.microprofile.testing + helidon-microprofile-testing-junit5 + test + + + org.hamcrest + hamcrest-all + test + + org.projectlombok @@ -86,13 +129,15 @@ SOFTWARE. --> ${version.lombok} provided - - - com.fasterxml.jackson.core - jackson-databind - - + + + + org.slf4j slf4j-jdk14 - - - io.helidon.tracing - helidon-tracing-zipkin - + + + + + + + + + + + + + + @@ -123,6 +177,15 @@ SOFTWARE. --> + + io.smallrye + jandex-maven-plugin + + + make-index + + + org.jboss.jandex jandex-maven-plugin diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java index 2094f8b..604ca84 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/Main.java @@ -95,8 +95,7 @@ private static Config buildConfig() { // need to // build it before we can add it to the list. again if there were three or less // we could pass the ConfigSource builder directly into the sources method of - // the - // config builder. + // the config builder. List> configSourcesToScan = new ArrayList<>(5); configSourcesToScan.add(ConfigSources.file("conf/storefront-config.yaml") .pollingStrategy(PollingStrategies.regular(Duration.ofSeconds(5))).optional().build()); diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java index 87cc70a..c172962 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/data/ItemRequest.java @@ -45,7 +45,7 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on @Data @NoArgsConstructor @AllArgsConstructor -@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\", \"Pin\", \"requestedCount\",5}") +@Schema(name = "ItemRequest", description = "Details of a Item reservation request", example = "{\"requestedItem\": \"Pin\", \"requestedCount\": 5}") public class ItemRequest { @Schema(required = true, description = "Name of the item being requested", example = "Pin") private String requestedItem; diff --git a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java index 2fe3bac..bfa3b03 100644 --- a/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java +++ b/helidon-storefront-full/src/main/java/com/oracle/labs/helidon/storefront/resources/StorefrontResource.java @@ -45,7 +45,6 @@ Software and the Larger Work(s), and to sublicense the foregoing rights on import org.eclipse.microprofile.faulttolerance.Fallback; import org.eclipse.microprofile.faulttolerance.Timeout; import org.eclipse.microprofile.metrics.annotation.Counted; -import org.eclipse.microprofile.metrics.annotation.Metered; import org.eclipse.microprofile.metrics.annotation.Timed; import org.eclipse.microprofile.openapi.annotations.Operation; import org.eclipse.microprofile.openapi.annotations.enums.SchemaType; @@ -137,9 +136,6 @@ public class StorefrontResource { @Fallback(fallbackMethod = "failedListStockItem") // add a timer to track how long is spent in this call @Timed(name = "listAllStockTimer") - // add a Meter to track how often we're called, absolute=true means the name - // given is used directly and not added to the class - @Metered(name = "listAllStockMeter", absolute = true) @Operation(summary = "List stock items", description = "Returns a list of all of the stock items currently held in the database (the list may be empty if there are no items)") @APIResponse(description = "A set of ItemDetails representing the current data in the database", responseCode = "200", content = @Content(schema = @Schema(name = "ItemDetails", implementation = ItemDetails.class, type = SchemaType.ARRAY), example = "[{\"itemCount\": 10, \"itemName\": \"Pencil\"}," + "{\"itemCount\": 50, \"itemName\": \"Eraser\"}," + "{\"itemCount\": 4600, \"itemName\": \"Pin\"}," @@ -191,7 +187,7 @@ public Collection listAllStock() { @APIResponse(description = "The requested change does not meet the minimum level required for the change (i.e. is <= the minimumChange value)", responseCode = "406") @APIResponse(description = "There are not enough of the requested item to fulfil your request", responseCode = "409") public ItemDetails reserveStockItem( - @RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\",\"Pencil\",\"requestedCount\",5}")) ItemRequest itemRequest, + @RequestBody(description = "The details of the item being requested", required = true, content = @Content(schema = @Schema(name = "ItemRequest", implementation = ItemRequest.class), example = "{\"requestedItem\": \"Pencil\",\"requestedCount\": 5}")) ItemRequest itemRequest, @Context SecurityContext securityContext) throws MinimumChangeException, UnknownItemException, NotEnoughItemsException { log.info("Requesting the reservation of " + itemRequest.getRequestedCount() + " items of "