gnodet commented on PR #1771:
URL: https://github.com/apache/maven-resolver/pull/1771#issuecomment-7370875152
Thanks for working on this! The approach of checking protocol support
upfront with `canHandle()` makes sense.
I noticed a potential issue in the test changes:
In `HttpTransporterTest.java` and `ClasspathTransporterTest.java`, the tests
are calling `canHandle()` with `"bad:/void"` (a URL-like string), but
`canHandle()` expects just the protocol part as a string parameter.
Looking at the usage in `DefaultTransporterProvider`:
```java
if (!factory.getComponent().canHandle(repository.getProtocol())) {
```
The `repository.getProtocol()` returns just the protocol (e.g., `"http"`,
`"https"`, `"file"`), not a full URL.
So the tests should probably be:
```java
assertFalse(factory.canHandle("bad"));
```
instead of:
```java
assertFalse(factory.canHandle("bad:/void"));
```
Also, minor formatting note: there's an extra blank line before the
`@Override` annotation in `FileTransporterFactory.java`.
_Claude Code on behalf of Guillaume Nodet_
--
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]