From b6966af15438d4e7827892fe7ccb45443bfd320b Mon Sep 17 00:00:00 2001 From: Santiago Pericas-Geertsen Date: Tue, 13 Aug 2024 15:14:41 -0400 Subject: [PATCH] Includes application.yaml for app and test. Signed-off-by: Santiago Pericas-Geertsen --- examples/webserver/grpc/pom.xml | 2 +- .../grpc/src/main/resources/application.yaml | 30 +++++++++++++++++++ .../webserver/grpc/StringServiceTest.java | 15 ---------- .../grpc/src/test/resources/application.yaml | 15 ++++++++++ 4 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 examples/webserver/grpc/src/main/resources/application.yaml diff --git a/examples/webserver/grpc/pom.xml b/examples/webserver/grpc/pom.xml index 2866f443..7485f246 100644 --- a/examples/webserver/grpc/pom.xml +++ b/examples/webserver/grpc/pom.xml @@ -66,7 +66,7 @@ javax.annotation javax.annotation-api - true + provided io.helidon.webserver.testing.junit5 diff --git a/examples/webserver/grpc/src/main/resources/application.yaml b/examples/webserver/grpc/src/main/resources/application.yaml new file mode 100644 index 00000000..00b3aef2 --- /dev/null +++ b/examples/webserver/grpc/src/main/resources/application.yaml @@ -0,0 +1,30 @@ +# +# Copyright (c) 2024 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. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +server: + port: 0 + tls: + trust: + keystore: + passphrase: "password" + trust-store: true + resource: + resource-path: "server.p12" + private-key: + keystore: + passphrase: "password" + resource: + resource-path: "server.p12" diff --git a/examples/webserver/grpc/src/test/java/io/helidon/examples/webserver/grpc/StringServiceTest.java b/examples/webserver/grpc/src/test/java/io/helidon/examples/webserver/grpc/StringServiceTest.java index bb8b4673..4929efa2 100644 --- a/examples/webserver/grpc/src/test/java/io/helidon/examples/webserver/grpc/StringServiceTest.java +++ b/examples/webserver/grpc/src/test/java/io/helidon/examples/webserver/grpc/StringServiceTest.java @@ -30,11 +30,9 @@ import io.helidon.webclient.grpc.GrpcClient; import io.helidon.webserver.Router; import io.helidon.webserver.WebServer; -import io.helidon.webserver.WebServerConfig; import io.helidon.webserver.grpc.GrpcRouting; import io.helidon.webserver.testing.junit5.ServerTest; import io.helidon.webserver.testing.junit5.SetUpRoute; -import io.helidon.webserver.testing.junit5.SetUpServer; import io.grpc.Channel; import io.grpc.stub.StreamObserver; @@ -66,19 +64,6 @@ private StringServiceTest(WebServer server) { .build(); } - @SetUpServer - public static void setup(WebServerConfig.Builder builder) { - builder.tls(tls -> tls.privateKey(key -> key - .keystore(store -> store - .passphrase("password") - .keystore(Resource.create("server.p12")))) - .privateKeyCertChain(key -> key - .keystore(store -> store - .trustStore(true) - .passphrase("password") - .keystore(Resource.create("server.p12"))))); - } - @SetUpRoute static void routing(Router.RouterBuilder router) { router.addRouting(GrpcRouting.builder().service(new StringService())); diff --git a/examples/webserver/grpc/src/test/resources/application.yaml b/examples/webserver/grpc/src/test/resources/application.yaml index 84409629..78f88534 100644 --- a/examples/webserver/grpc/src/test/resources/application.yaml +++ b/examples/webserver/grpc/src/test/resources/application.yaml @@ -14,6 +14,21 @@ # limitations under the License. # +server: + port: 0 + tls: + trust: + keystore: + passphrase: "password" + trust-store: true + resource: + resource-path: "server.p12" + private-key: + keystore: + passphrase: "password" + resource: + resource-path: "server.p12" + grpc-client: poll-wait-time: PT30S abort-poll-time-expired: true