Skip to content

Commit

Permalink
apacheGH-39170: [Java] Improve error message explaining why TestTls m…
Browse files Browse the repository at this point in the history
…ight fail
  • Loading branch information
jbonofre committed Dec 11, 2023
1 parent 92e56ba commit dc5a99f
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -47,7 +48,11 @@ static Path exampleTlsRootCert() {

static List<CertKeyPair> exampleTlsCerts() {
final Path root = getFlightTestDataRoot();
return Arrays.asList(new CertKeyPair(root.resolve("cert0.pem").toFile(), root.resolve("cert0.pkcs1").toFile()),
final Path cert0Pem = root.resolve("cert0.pem");
if (!Files.exists(cert0Pem)) {
throw new RuntimeException(cert0Pem + " doesn't exist. Make sure submodules are initialized (see https://arrow.apache.org/docs/dev/developers/java/building.html#building)");
}
return Arrays.asList(new CertKeyPair(cert0Pem.toFile(), root.resolve("cert0.pkcs1").toFile()),
new CertKeyPair(root.resolve("cert1.pem").toFile(), root.resolve("cert1.pkcs1").toFile()));
}

Expand Down

0 comments on commit dc5a99f

Please sign in to comment.