jamesnetherton commented on code in PR #6943:
URL: https://github.com/apache/camel-quarkus/pull/6943#discussion_r1930418416


##########
integration-tests/ssh/src/test/java/org/apache/camel/quarkus/component/ssh/it/SshTestResource.java:
##########
@@ -80,7 +80,7 @@ public Map<String, String> start() {
             sshd = SshServer.setUpDefaultServer();
             sshd.setPort(edPort);
             sshd.setKeyPairProvider(new FileKeyPairProvider(
-                    
Paths.get(Thread.currentThread().getContextClassLoader().getResource("edDSA/key_ed25519.pem").toURI())));
+                    Paths.get("target/test-classes/edDSA/key_ed25519.pem")));

Review Comment:
   There is no `target/test-classes` in the platform because the tests are run 
directly from the test JAR.
   
   Maybe something like this would work:
   
   ```java
   try (InputStream stream = Thread.currentThread().getContextClassLoader()
           .getResourceAsStream("edDSA/key_ed25519.pem")) {
       if (stream == null) {
           throw new RuntimeException("Failed to load edDSA/key_ed25519.pem");
       }
   
       Path path = Paths.get("target/key_ed25519.pem");
       Files.write(stream.readAllBytes(), path.toFile());
       sshd.setKeyPairProvider(new FileKeyPairProvider(path));
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to