|
| 1 | +/* |
| 2 | + * Copyright (c) 2016-2021 Michael Zhang <[email protected]> |
| 3 | + * |
| 4 | + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated |
| 5 | + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the |
| 6 | + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to |
| 7 | + * permit persons to whom the Software is furnished to do so, subject to the following conditions: |
| 8 | + * |
| 9 | + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the |
| 10 | + * Software. |
| 11 | + * |
| 12 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
| 13 | + * WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
| 14 | + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
| 15 | + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 16 | + */ |
| 17 | + |
| 18 | +package net.devh.boot.grpc.test.setup; |
| 19 | + |
| 20 | +import org.springframework.boot.test.context.SpringBootTest; |
| 21 | +import org.springframework.test.annotation.DirtiesContext; |
| 22 | +import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; |
| 23 | + |
| 24 | +import lombok.extern.slf4j.Slf4j; |
| 25 | +import net.devh.boot.grpc.test.config.BaseAutoConfiguration; |
| 26 | +import net.devh.boot.grpc.test.config.ServiceConfiguration; |
| 27 | + |
| 28 | +/** |
| 29 | + * A test checking that the server and client can start and connect to each other with minimal config. |
| 30 | + * |
| 31 | + * @author Daniel Theuke ([email protected]) |
| 32 | + */ |
| 33 | +@Slf4j |
| 34 | +@SpringBootTest(properties = { |
| 35 | + "grpc.server.port=-1", |
| 36 | + "grpc.server.in-process-name=test", |
| 37 | + "grpc.server.security.enabled=true", |
| 38 | + "grpc.server.security.certificateChain=file:src/test/resources/certificates/server.crt", |
| 39 | + "grpc.server.security.privateKey=file:src/test/resources/certificates/server.key", |
| 40 | + "grpc.server.security.trustCertCollection=file:src/test/resources/certificates/trusted-clients-collection", |
| 41 | + "grpc.server.security.clientAuth=REQUIRE", |
| 42 | + |
| 43 | + "grpc.client.test.address=in-process:test", |
| 44 | + "grpc.client.test.security.authorityOverride=localhost", |
| 45 | + "grpc.client.test.security.trustCertCollection=file:src/test/resources/certificates/trusted-servers-collection", |
| 46 | + "grpc.client.test.security.clientAuthEnabled=true", |
| 47 | + "grpc.client.test.security.certificateChain=file:src/test/resources/certificates/client1.crt", |
| 48 | + "grpc.client.test.security.privateKey=file:src/test/resources/certificates/client1.key"}) |
| 49 | +@SpringJUnitConfig(classes = {ServiceConfiguration.class, BaseAutoConfiguration.class}) |
| 50 | +@DirtiesContext |
| 51 | +public class SelfSignedInProcessSetupTest extends AbstractSimpleServerClientTest { |
| 52 | + |
| 53 | + public SelfSignedInProcessSetupTest() { |
| 54 | + log.info("--- SelfSignedInProcessSetupTest ---"); |
| 55 | + } |
| 56 | + |
| 57 | +} |
0 commit comments