forked from quarkus-qe/quarkus-test-suite
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate gRPC same server TLS test to new API
- Loading branch information
1 parent
c049576
commit bcc3d14
Showing
7 changed files
with
63 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
http/grpc/src/test/java/io/quarkus/ts/http/grpc/GrpcTlsSeparateServerIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
package io.quarkus.ts.http.grpc; | ||
|
||
import static io.quarkus.test.services.Certificate.Format.PEM; | ||
|
||
import io.quarkus.test.bootstrap.CloseableManagedChannel; | ||
import io.quarkus.test.bootstrap.GrpcService; | ||
import io.quarkus.test.bootstrap.RestService; | ||
import io.quarkus.test.scenarios.QuarkusScenario; | ||
import io.quarkus.test.security.certificate.Certificate.PemCertificate; | ||
import io.quarkus.test.security.certificate.CertificateBuilder; | ||
import io.quarkus.test.services.Certificate; | ||
import io.quarkus.test.services.QuarkusApplication; | ||
import io.restassured.specification.RequestSpecification; | ||
|
||
@QuarkusScenario | ||
public class GrpcTlsSeparateServerIT implements GRPCIT, StreamingHttpIT, ReflectionHttpIT { | ||
|
||
private static final String CERT_PREFIX = "grpc-tls-separate-server"; | ||
|
||
@QuarkusApplication(grpc = true, ssl = true, certificates = @Certificate(prefix = CERT_PREFIX, format = PEM, configureKeystore = true, configureTruststore = true)) | ||
static final GrpcService app = (GrpcService) new GrpcService() | ||
.withProperty("quarkus.profile", "ssl") | ||
.withProperty("grpc.client.ca-cert", CertificateBuilder.INSTANCE_KEY, GrpcTlsSeparateServerIT::getClientCaCert) | ||
.withProperty("grpc.server.cert", CertificateBuilder.INSTANCE_KEY, GrpcTlsSeparateServerIT::getServerCert) | ||
.withProperty("grpc.server.key", CertificateBuilder.INSTANCE_KEY, GrpcTlsSeparateServerIT::getServerKey); | ||
|
||
public CloseableManagedChannel getChannel() { | ||
return app.securedGrpcChannel(); | ||
} | ||
|
||
@Override | ||
public RestService app() { | ||
return app; | ||
} | ||
|
||
@Override | ||
public RequestSpecification given() { | ||
return app().relaxedHttps().given(); | ||
} | ||
|
||
private static String getClientCaCert(CertificateBuilder certificateBuilder) { | ||
return getPemCertificate(certificateBuilder).truststorePath(); | ||
} | ||
|
||
private static String getServerCert(CertificateBuilder certificateBuilder) { | ||
return getPemCertificate(certificateBuilder).certPath(); | ||
} | ||
|
||
private static String getServerKey(CertificateBuilder certificateBuilder) { | ||
return getPemCertificate(certificateBuilder).keyPath(); | ||
} | ||
|
||
private static PemCertificate getPemCertificate(CertificateBuilder certificateBuilder) { | ||
return (PemCertificate) certificateBuilder.findCertificateByPrefix(CERT_PREFIX); | ||
} | ||
} |
48 changes: 0 additions & 48 deletions
48
http/grpc/src/test/java/io/quarkus/ts/http/grpc/TLSIT.java
This file was deleted.
Oops, something went wrong.