Skip to content

Commit

Permalink
Includes application.yaml for app and test.
Browse files Browse the repository at this point in the history
Signed-off-by: Santiago Pericas-Geertsen <[email protected]>
  • Loading branch information
spericas committed Aug 13, 2024
1 parent ee52d5f commit ccf17ee
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/webserver/grpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<!-- required for @Generated -->
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<optional>true</optional>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.helidon.webserver.testing.junit5</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
/**
* Example of gRPC in webserver.
*/
package io.helidon.examples.webserver.grpc;
package io.helidon.examples.webserver.grpc;
30 changes: 30 additions & 0 deletions examples/webserver/grpc/src/main/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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()));
Expand Down
15 changes: 15 additions & 0 deletions examples/webserver/grpc/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ccf17ee

Please sign in to comment.