Skip to content

Commit a81e242

Browse files
committed
Don't check for file existence in tests.
1 parent 36222a0 commit a81e242

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

s2a/src/test/java/io/grpc/s2a/S2AChannelCredentialsTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import io.grpc.InsecureChannelCredentials;
2424
import io.grpc.TlsChannelCredentials;
2525
import java.io.File;
26-
import java.io.IOException;
2726
import org.junit.Test;
2827
import org.junit.runner.RunWith;
2928
import org.junit.runners.JUnit4;
@@ -129,17 +128,8 @@ private static ChannelCredentials getTlsChannelCredentials() throws Exception {
129128
String certChainPath = "src/test/resources/client_cert.pem";
130129
String trustBundlePath = "src/test/resources/root_cert.pem";
131130
File privateKeyFile = new File(privateKeyPath);
132-
if (!privateKeyFile.exists()) {
133-
throw new IOException(privateKeyPath + " does not exist");
134-
}
135131
File certChainFile = new File(certChainPath);
136-
if (!certChainFile.exists()) {
137-
throw new IOException(certChainPath + " does not exist");
138-
}
139132
File trustBundleFile = new File(trustBundlePath);
140-
if (!trustBundleFile.exists()) {
141-
throw new IOException(trustBundlePath + " does not exist");
142-
}
143133
return TlsChannelCredentials.newBuilder()
144134
.keyManager(certChainFile, privateKeyFile)
145135
.trustManager(trustBundleFile)

s2a/src/test/java/io/grpc/s2a/handshaker/IntegrationTest.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
import io.netty.handler.ssl.SslProvider;
4646
import java.io.ByteArrayInputStream;
4747
import java.io.File;
48-
import java.io.IOException;
4948
import java.util.concurrent.FutureTask;
5049
import java.util.logging.Logger;
5150
import javax.net.ssl.SSLException;
@@ -210,17 +209,8 @@ public void clientCommunicateUsingMtlsToS2ACredentials_succeeds() throws Excepti
210209
String certChainPath = "src/test/resources/client_cert.pem";
211210
String trustBundlePath = "src/test/resources/root_cert.pem";
212211
File privateKeyFile = new File(privateKeyPath);
213-
if (!privateKeyFile.exists()) {
214-
throw new IOException(privateKeyPath + " does not exist");
215-
}
216212
File certChainFile = new File(certChainPath);
217-
if (!certChainFile.exists()) {
218-
throw new IOException(certChainPath + " does not exist");
219-
}
220213
File trustBundleFile = new File(trustBundlePath);
221-
if (!trustBundleFile.exists()) {
222-
throw new IOException(trustBundlePath + " does not exist");
223-
}
224214
ChannelCredentials s2aChannelCredentials =
225215
TlsChannelCredentials.newBuilder()
226216
.keyManager(certChainFile, privateKeyFile)

0 commit comments

Comments
 (0)