Skip to content

Commit

Permalink
Don't check for file existence in tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmehta19 committed Sep 27, 2024
1 parent 36222a0 commit a81e242
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
10 changes: 0 additions & 10 deletions s2a/src/test/java/io/grpc/s2a/S2AChannelCredentialsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import io.grpc.InsecureChannelCredentials;
import io.grpc.TlsChannelCredentials;
import java.io.File;
import java.io.IOException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
Expand Down Expand Up @@ -129,17 +128,8 @@ private static ChannelCredentials getTlsChannelCredentials() throws Exception {
String certChainPath = "src/test/resources/client_cert.pem";
String trustBundlePath = "src/test/resources/root_cert.pem";
File privateKeyFile = new File(privateKeyPath);
if (!privateKeyFile.exists()) {
throw new IOException(privateKeyPath + " does not exist");
}
File certChainFile = new File(certChainPath);
if (!certChainFile.exists()) {
throw new IOException(certChainPath + " does not exist");
}
File trustBundleFile = new File(trustBundlePath);
if (!trustBundleFile.exists()) {
throw new IOException(trustBundlePath + " does not exist");
}
return TlsChannelCredentials.newBuilder()
.keyManager(certChainFile, privateKeyFile)
.trustManager(trustBundleFile)
Expand Down
10 changes: 0 additions & 10 deletions s2a/src/test/java/io/grpc/s2a/handshaker/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import io.netty.handler.ssl.SslProvider;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.util.concurrent.FutureTask;
import java.util.logging.Logger;
import javax.net.ssl.SSLException;
Expand Down Expand Up @@ -210,17 +209,8 @@ public void clientCommunicateUsingMtlsToS2ACredentials_succeeds() throws Excepti
String certChainPath = "src/test/resources/client_cert.pem";
String trustBundlePath = "src/test/resources/root_cert.pem";
File privateKeyFile = new File(privateKeyPath);
if (!privateKeyFile.exists()) {
throw new IOException(privateKeyPath + " does not exist");
}
File certChainFile = new File(certChainPath);
if (!certChainFile.exists()) {
throw new IOException(certChainPath + " does not exist");
}
File trustBundleFile = new File(trustBundlePath);
if (!trustBundleFile.exists()) {
throw new IOException(trustBundlePath + " does not exist");
}
ChannelCredentials s2aChannelCredentials =
TlsChannelCredentials.newBuilder()
.keyManager(certChainFile, privateKeyFile)
Expand Down

0 comments on commit a81e242

Please sign in to comment.