From be6955b7ef3c833dd633e9a4ca7fbbd51cb23f8e Mon Sep 17 00:00:00 2001 From: Romain Grecourt Date: Wed, 21 Jun 2023 14:42:39 -0700 Subject: [PATCH] Update Neo4j example: - move the example from examples/integrations/neo4j/neo4j-se to examples/integrations/neo4j - renamed package from io.helidon.examples.integrations.neo4j.se to io.helidon.examples.integrations.neo4j - update README - fix metrics Updated module-info and poms to remove CDI dependencies. Adjust copyright years. Update README to state JDK20 instead of JDK21. --- etc/copyright-exclude.txt | 8 +- .../neo4j/{neo4j-se => }/README.md | 8 +- .../integrations/neo4j/neo4j-se/.dockerignore | 1 - examples/integrations/neo4j/neo4j-se/pom.xml | 117 ------------------ examples/integrations/neo4j/pom.xml | 113 +++++++++++++++-- .../examples/integrations/neo4j}/Main.java | 17 +-- .../integrations/neo4j}/MovieService.java | 14 +-- .../integrations/neo4j}/domain/Actor.java | 4 +- .../integrations/neo4j}/domain/Movie.java | 4 +- .../neo4j}/domain/MovieRepository.java | 4 +- .../integrations/neo4j}/domain/Person.java | 4 +- .../neo4j}/domain/package-info.java | 2 +- .../integrations/neo4j}/package-info.java | 8 +- .../src/main/resources/application.yaml | 2 +- .../src/main/resources/logging.properties | 5 +- .../integrations/neo4j}/MainTest.java | 22 +++- .../integrations/neo4j}/package-info.java | 6 +- .../health/src/main/java/module-info.java | 2 +- integrations/neo4j/metrics/pom.xml | 6 - .../neo4j/metrics/Neo4jMetricsSupport.java | 1 + .../metrics/src/main/java/module-info.java | 7 +- integrations/neo4j/neo4j/pom.xml | 6 - .../neo4j/src/main/java/module-info.java | 6 +- 23 files changed, 162 insertions(+), 205 deletions(-) rename examples/integrations/neo4j/{neo4j-se => }/README.md (94%) delete mode 100644 examples/integrations/neo4j/neo4j-se/.dockerignore delete mode 100644 examples/integrations/neo4j/neo4j-se/pom.xml rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/Main.java (88%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/MovieService.java (80%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/domain/Actor.java (94%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/domain/Movie.java (95%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/domain/MovieRepository.java (96%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/domain/Person.java (94%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/domain/package-info.java (91%) rename examples/integrations/neo4j/{neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se => src/main/java/io/helidon/examples/integrations/neo4j}/package-info.java (74%) rename examples/integrations/neo4j/{neo4j-se => }/src/main/resources/application.yaml (92%) rename examples/integrations/neo4j/{neo4j-se => }/src/main/resources/logging.properties (91%) rename examples/integrations/neo4j/{neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se => src/test/java/io/helidon/examples/integrations/neo4j}/MainTest.java (86%) rename examples/integrations/neo4j/{neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se => src/test/java/io/helidon/examples/integrations/neo4j}/package-info.java (78%) diff --git a/etc/copyright-exclude.txt b/etc/copyright-exclude.txt index 82ee16860d2..b8ccd79e429 100644 --- a/etc/copyright-exclude.txt +++ b/etc/copyright-exclude.txt @@ -47,10 +47,10 @@ node_modules archetype-resources/pom.xml # excluded as it contains both Oracle and original copyright notice src/main/java/org/jboss/weld/bean/proxy/ProxyFactory.java -src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Actor.java -src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Movie.java -src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Person.java -src/main/java/io/helidon/examples/integrations/neo4j/se/domain/MovieRepository.java +src/main/java/io/helidon/examples/integrations/neo4j/domain/Actor.java +src/main/java/io/helidon/examples/integrations/neo4j/domain/Movie.java +src/main/java/io/helidon/examples/integrations/neo4j/domain/Person.java +src/main/java/io/helidon/examples/integrations/neo4j/domain/MovieRepository.java etc/THIRD_PARTY_LICENSES.xml etc/HELIDON_THIRD_PARTY_LICENSES.xml etc/dependency-check-suppression.xml diff --git a/examples/integrations/neo4j/neo4j-se/README.md b/examples/integrations/neo4j/README.md similarity index 94% rename from examples/integrations/neo4j/neo4j-se/README.md rename to examples/integrations/neo4j/README.md index 76387467a97..d35611349cd 100644 --- a/examples/integrations/neo4j/neo4j-se/README.md +++ b/examples/integrations/neo4j/README.md @@ -10,7 +10,7 @@ docker run --publish=7474:7474 --publish=7687:7687 -e 'NEO4J_AUTH=neo4j/secret' Goto the Neo4j browser and play the first step of the movies graph: [`:play movies`](http://localhost:7474/browser/?cmd=play&arg=movies). -Build and run with With JDK21 +Build and run with JDK20 ```bash mvn package java -jar target/helidon-examples-integration-neo4j-nima.jar @@ -32,11 +32,7 @@ Enable them in the driver: metricsEnabled: true ``` - ```` curl localhost:8080/observe/health -```` - -```` curl localhost:8080/observe/metrics -```` \ No newline at end of file +```` diff --git a/examples/integrations/neo4j/neo4j-se/.dockerignore b/examples/integrations/neo4j/neo4j-se/.dockerignore deleted file mode 100644 index c8b241f2215..00000000000 --- a/examples/integrations/neo4j/neo4j-se/.dockerignore +++ /dev/null @@ -1 +0,0 @@ -target/* \ No newline at end of file diff --git a/examples/integrations/neo4j/neo4j-se/pom.xml b/examples/integrations/neo4j/neo4j-se/pom.xml deleted file mode 100644 index dc6b627c225..00000000000 --- a/examples/integrations/neo4j/neo4j-se/pom.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - - - 4.0.0 - - io.helidon.applications - helidon-nima - 4.0.0-SNAPSHOT - ../../../../applications/nima/pom.xml - - io.helidon.examples.integrations.neo4j - helidon-examples-integration-neo4j-se - Helidon Integrations Neo4j SE Example - - - io.helidon.examples.integrations.neo4j.se.Main - 5.8.0 - - - - - io.helidon.nima.webserver - helidon-nima-webserver - - - io.helidon.health - helidon-health-checks - - - io.helidon.nima.http.media - helidon-nima-http-media-jsonp - - - io.helidon.nima.http.media - helidon-nima-http-media-jsonb - - - io.helidon.config - helidon-config-yaml - - - io.helidon.nima.observe - helidon-nima-observe - - - io.helidon.nima.observe - helidon-nima-observe-health - - - io.helidon.integrations.neo4j - helidon-integrations-neo4j - - - io.helidon.integrations.neo4j - helidon-integrations-neo4j-health - - - io.helidon.nima.testing.junit5 - helidon-nima-testing-junit5-webserver - test - - - org.junit.jupiter - junit-jupiter-api - test - - - org.hamcrest - hamcrest-all - test - - - - org.neo4j.test - neo4j-harness - ${neo4j-harness.version} - test - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy-libs - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - - diff --git a/examples/integrations/neo4j/pom.xml b/examples/integrations/neo4j/pom.xml index 8402e58b3c6..3a3c60fef69 100644 --- a/examples/integrations/neo4j/pom.xml +++ b/examples/integrations/neo4j/pom.xml @@ -17,21 +17,112 @@ --> - + 4.0.0 - io.helidon.examples.integrations - helidon-examples-integrations-project + io.helidon.applications + helidon-nima 4.0.0-SNAPSHOT + ../../../applications/nima/pom.xml - io.helidon.examples.integrations.neo4j - helidon-examples-integrations-neo4j-project - Helidon Neo4j Integrations Examples - pom + helidon-examples-integration-neo4j + Helidon Integrations Neo4j Example - - neo4j-se - + + io.helidon.examples.integrations.neo4j.Main + 5.8.0 + + + + io.helidon.nima.webserver + helidon-nima-webserver + + + io.helidon.health + helidon-health-checks + + + io.helidon.nima.http.media + helidon-nima-http-media-jsonp + + + io.helidon.nima.http.media + helidon-nima-http-media-jsonb + + + io.helidon.config + helidon-config-yaml + + + io.helidon.nima.observe + helidon-nima-observe + + + io.helidon.nima.observe + helidon-nima-observe-health + + + io.helidon.nima.observe + helidon-nima-observe-metrics + + + io.helidon.metrics + helidon-metrics + + + io.helidon.integrations.neo4j + helidon-integrations-neo4j + + + io.helidon.integrations.neo4j + helidon-integrations-neo4j-health + + + io.helidon.integrations.neo4j + helidon-integrations-neo4j-metrics + + + io.helidon.nima.testing.junit5 + helidon-nima-testing-junit5-webserver + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.hamcrest + hamcrest-all + test + + + + org.neo4j.test + neo4j-harness + ${neo4j-harness.version} + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + copy-libs + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/Main.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/Main.java similarity index 88% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/Main.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/Main.java index 1a08ec211f3..8ad950fb79d 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/Main.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,15 +14,16 @@ * limitations under the License. */ -package io.helidon.examples.integrations.neo4j.se; +package io.helidon.examples.integrations.neo4j; import io.helidon.config.Config; -import io.helidon.examples.integrations.neo4j.se.domain.MovieRepository; +import io.helidon.examples.integrations.neo4j.domain.MovieRepository; import io.helidon.health.checks.DeadlockHealthCheck; import io.helidon.health.checks.DiskSpaceHealthCheck; import io.helidon.health.checks.HeapMemoryHealthCheck; import io.helidon.integrations.neo4j.Neo4j; import io.helidon.integrations.neo4j.health.Neo4jHealthCheck; +import io.helidon.integrations.neo4j.metrics.Neo4jMetricsSupport; import io.helidon.logging.common.LogConfig; import io.helidon.nima.http.media.jsonp.JsonpSupport; import io.helidon.nima.observe.ObserveFeature; @@ -71,17 +72,19 @@ static void startServer() { * Updates HTTP Routing. */ static void routing(Builder routing) { - Neo4j neo4j = Neo4j.create(Config.create().get("neo4j")); + Driver neo4jDriver = neo4j.driver(); - Neo4jHealthCheck healthCheck = Neo4jHealthCheck.create(neo4j.driver()); + Neo4jMetricsSupport.builder() + .driver(neo4jDriver) + .build() + .initialize(); - Driver neo4jDriver = neo4j.driver(); + Neo4jHealthCheck healthCheck = Neo4jHealthCheck.create(neo4jDriver); MovieService movieService = new MovieService(new MovieRepository(neo4jDriver)); ObserveFeature observe = ObserveFeature.builder() - .useSystemServices(false) .addProvider(HealthObserveProvider.create(HealthFeature.builder() .useSystemServices(false) .addCheck(HeapMemoryHealthCheck.create()) diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/MovieService.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/MovieService.java similarity index 80% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/MovieService.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/MovieService.java index 78f5d849eb3..5c8a87611dd 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/MovieService.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/MovieService.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,9 +14,9 @@ * limitations under the License. */ -package io.helidon.examples.integrations.neo4j.se; +package io.helidon.examples.integrations.neo4j; -import io.helidon.examples.integrations.neo4j.se.domain.MovieRepository; +import io.helidon.examples.integrations.neo4j.domain.MovieRepository; import io.helidon.nima.webserver.http.HttpRules; import io.helidon.nima.webserver.http.HttpService; import io.helidon.nima.webserver.http.ServerRequest; @@ -38,15 +38,9 @@ public MovieService(MovieRepository movieRepository) { this.movieRepository = movieRepository; } - /** - * Main routing done here. - * - * @param rules - */ @Override public void routing(HttpRules rules) { - rules - .get("/api/movies", this::findMoviesHandler); + rules.get("/api/movies", this::findMoviesHandler); } private void findMoviesHandler(ServerRequest request, ServerResponse response) { diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Actor.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Actor.java similarity index 94% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Actor.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Actor.java index a3c1aed41eb..ee9d5d8e3e1 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Actor.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Actor.java @@ -16,7 +16,7 @@ * */ -package io.helidon.examples.integrations.neo4j.se.domain; +package io.helidon.examples.integrations.neo4j.domain; import java.util.ArrayList; import java.util.List; @@ -24,7 +24,7 @@ /* * Helidon changes are under the copyright of: * - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Movie.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Movie.java similarity index 95% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Movie.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Movie.java index dc70834a4cd..17c9ca519b8 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Movie.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Movie.java @@ -16,7 +16,7 @@ * */ -package io.helidon.examples.integrations.neo4j.se.domain; +package io.helidon.examples.integrations.neo4j.domain; import java.util.ArrayList; import java.util.List; @@ -24,7 +24,7 @@ /* * Helidon changes are under the copyright of: * - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/MovieRepository.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/MovieRepository.java similarity index 96% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/MovieRepository.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/MovieRepository.java index a0556af9f68..40a2c4833f2 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/MovieRepository.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/MovieRepository.java @@ -16,7 +16,7 @@ * */ -package io.helidon.examples.integrations.neo4j.se.domain; +package io.helidon.examples.integrations.neo4j.domain; import java.util.List; @@ -26,7 +26,7 @@ /* * Helidon changes are under the copyright of: * - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Person.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Person.java similarity index 94% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Person.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Person.java index 23c42c813f8..5fb2a1abe45 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/Person.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/Person.java @@ -16,12 +16,12 @@ * */ -package io.helidon.examples.integrations.neo4j.se.domain; +package io.helidon.examples.integrations.neo4j.domain; /* * Helidon changes are under the copyright of: * - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/package-info.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/package-info.java similarity index 91% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/package-info.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/package-info.java index 309bdf85bf9..215caf712f1 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/domain/package-info.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/domain/package-info.java @@ -17,4 +17,4 @@ /** * Domain objects for movies. */ -package io.helidon.examples.integrations.neo4j.se.domain; +package io.helidon.examples.integrations.neo4j.domain; diff --git a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/package-info.java b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/package-info.java similarity index 74% rename from examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/package-info.java rename to examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/package-info.java index 3a4836241e1..6d132dbc7eb 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/java/io/helidon/examples/integrations/neo4j/se/package-info.java +++ b/examples/integrations/neo4j/src/main/java/io/helidon/examples/integrations/neo4j/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,9 +15,9 @@ */ /** - * Nima Neo4j demo application. + * Helidon Integrations Neo4j Example. *

* - * @see io.helidon.examples.integrations.neo4j.se.Main + * @see io.helidon.examples.integrations.neo4j.Main */ -package io.helidon.examples.integrations.neo4j.se; +package io.helidon.examples.integrations.neo4j; diff --git a/examples/integrations/neo4j/neo4j-se/src/main/resources/application.yaml b/examples/integrations/neo4j/src/main/resources/application.yaml similarity index 92% rename from examples/integrations/neo4j/neo4j-se/src/main/resources/application.yaml rename to examples/integrations/neo4j/src/main/resources/application.yaml index 3284878c081..63f95335305 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/resources/application.yaml +++ b/examples/integrations/neo4j/src/main/resources/application.yaml @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/integrations/neo4j/neo4j-se/src/main/resources/logging.properties b/examples/integrations/neo4j/src/main/resources/logging.properties similarity index 91% rename from examples/integrations/neo4j/neo4j-se/src/main/resources/logging.properties rename to examples/integrations/neo4j/src/main/resources/logging.properties index 077e2f729bd..164c69e8d0b 100644 --- a/examples/integrations/neo4j/neo4j-se/src/main/resources/logging.properties +++ b/examples/integrations/neo4j/src/main/resources/logging.properties @@ -1,5 +1,5 @@ # -# Copyright (c) 2023 Oracle and/or its affiliates. +# Copyright (c) 2021, 2023 Oracle and/or its affiliates. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -27,8 +27,7 @@ java.util.logging.SimpleFormatter.format=%1$tY.%1$tm.%1$td %1$tH:%1$tM:%1$tS %4$ .level=INFO # Component specific log levels -#io.helidon.reactive.webserver.level=INFO +#io.helidon.nima.webserver.level=INFO #io.helidon.config.level=INFO #io.helidon.security.level=INFO #io.helidon.common.level=INFO -#io.netty.level=INFO diff --git a/examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/MainTest.java b/examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/MainTest.java similarity index 86% rename from examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/MainTest.java rename to examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/MainTest.java index 2f6a117b9b9..68078f49857 100644 --- a/examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/MainTest.java +++ b/examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/MainTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,7 +14,7 @@ * limitations under the License. */ -package io.helidon.examples.integrations.neo4j.se; +package io.helidon.examples.integrations.neo4j; import io.helidon.common.http.Http; import io.helidon.nima.testing.junit5.webserver.ServerTest; @@ -22,8 +22,10 @@ import io.helidon.nima.webclient.http1.Http1Client; import io.helidon.nima.webclient.http1.Http1ClientResponse; import io.helidon.nima.webserver.http.HttpRouting; + import jakarta.json.JsonArray; import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import org.neo4j.harness.Neo4j; import org.neo4j.harness.Neo4jBuilders; @@ -50,15 +52,25 @@ public MainTest(Http1Client webClient) { static void routing(HttpRouting.Builder builder) { //Setup embedded Neo4j Server and inject in routing embeddedDatabaseServer = Neo4jBuilders.newInProcessBuilder() - .withDisabledServer() - .withFixture(FIXTURE) - .build(); + .withDisabledServer() + .withFixture(FIXTURE) + .build(); System.setProperty("neo4j.uri", embeddedDatabaseServer.boltURI().toString()); Main.routing(builder); } + @BeforeAll + static void startServer() { + //Setup embedded Neo4j Server and inject in routing + embeddedDatabaseServer = Neo4jBuilders.newInProcessBuilder() + .withDisabledServer() + .withFixture(FIXTURE) + .build(); + + System.setProperty("neo4j.uri", embeddedDatabaseServer.boltURI().toString()); + } @AfterAll static void stopServer() { diff --git a/examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/package-info.java b/examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/package-info.java similarity index 78% rename from examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/package-info.java rename to examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/package-info.java index 9b9d0a26efa..e9d169770e5 100644 --- a/examples/integrations/neo4j/neo4j-se/src/test/java/io/helidon/examples/integrations/neo4j/se/package-info.java +++ b/examples/integrations/neo4j/src/test/java/io/helidon/examples/integrations/neo4j/package-info.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Oracle and/or its affiliates. + * Copyright (c) 2021, 2023 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,6 @@ */ /** - * Tests for Neo4j Helidon Nima app. + * Tests for Helidon Integrations Neo4j Example. */ -package io.helidon.examples.integrations.neo4j.se; +package io.helidon.examples.integrations.neo4j; diff --git a/integrations/neo4j/health/src/main/java/module-info.java b/integrations/neo4j/health/src/main/java/module-info.java index 4f14cac0108..b66447da240 100644 --- a/integrations/neo4j/health/src/main/java/module-info.java +++ b/integrations/neo4j/health/src/main/java/module-info.java @@ -29,10 +29,10 @@ ) module io.helidon.integrations.neo4j.health { requires static io.helidon.common.features.api; + requires io.helidon.health; requires org.neo4j.driver; - requires io.helidon.health; exports io.helidon.integrations.neo4j.health; diff --git a/integrations/neo4j/metrics/pom.xml b/integrations/neo4j/metrics/pom.xml index 66a62ee5684..7e110adba8a 100644 --- a/integrations/neo4j/metrics/pom.xml +++ b/integrations/neo4j/metrics/pom.xml @@ -52,12 +52,6 @@ helidon-common-features-api true - - - jakarta.enterprise - jakarta.enterprise.cdi-api - true - diff --git a/integrations/neo4j/metrics/src/main/java/io/helidon/integrations/neo4j/metrics/Neo4jMetricsSupport.java b/integrations/neo4j/metrics/src/main/java/io/helidon/integrations/neo4j/metrics/Neo4jMetricsSupport.java index 11eefc0a4fb..890db36dc71 100644 --- a/integrations/neo4j/metrics/src/main/java/io/helidon/integrations/neo4j/metrics/Neo4jMetricsSupport.java +++ b/integrations/neo4j/metrics/src/main/java/io/helidon/integrations/neo4j/metrics/Neo4jMetricsSupport.java @@ -54,6 +54,7 @@ public class Neo4jMetricsSupport { private final LazyValue metricRegistry; private final Driver driver; + @SuppressWarnings("removal") private Neo4jMetricsSupport(Builder builder) { this.driver = builder.driver; // Assuming for the moment that VENDOR is the correct registry to use. diff --git a/integrations/neo4j/metrics/src/main/java/module-info.java b/integrations/neo4j/metrics/src/main/java/module-info.java index e8475cc5d25..ef6c30936ee 100644 --- a/integrations/neo4j/metrics/src/main/java/module-info.java +++ b/integrations/neo4j/metrics/src/main/java/module-info.java @@ -32,15 +32,10 @@ requires io.helidon.common; requires io.helidon.integrations.neo4j; + requires io.helidon.metrics; requires org.neo4j.driver; - requires microprofile.metrics.api; - requires io.helidon.metrics; - - requires static jakarta.cdi; - requires static jakarta.inject; - requires static jakarta.annotation; exports io.helidon.integrations.neo4j.metrics; } diff --git a/integrations/neo4j/neo4j/pom.xml b/integrations/neo4j/neo4j/pom.xml index c76927713e5..5c712875e59 100644 --- a/integrations/neo4j/neo4j/pom.xml +++ b/integrations/neo4j/neo4j/pom.xml @@ -48,12 +48,6 @@ helidon-common-features-api true - - - jakarta.enterprise - jakarta.enterprise.cdi-api - true - io.helidon.config helidon-config-mp diff --git a/integrations/neo4j/neo4j/src/main/java/module-info.java b/integrations/neo4j/neo4j/src/main/java/module-info.java index c2b2405d7b6..be636e63549 100644 --- a/integrations/neo4j/neo4j/src/main/java/module-info.java +++ b/integrations/neo4j/neo4j/src/main/java/module-info.java @@ -29,14 +29,10 @@ path = "Neo4j" ) module io.helidon.integrations.neo4j { - requires static io.helidon.common.features.api; - requires java.logging; - requires static jakarta.cdi; - requires static jakarta.inject; + requires static io.helidon.common.features.api; requires static io.helidon.config; - requires static io.helidon.config.mp; requires org.neo4j.driver;