gnodet-bot commented on code in PR #2348: URL: https://github.com/apache/maven-resolver/pull/2348#discussion_r4652317568
########## maven-resolver-impl/src/test/java/org/eclipse/aether/internal/impl/DefaultTransporterProviderTest.java: ########## @@ -0,0 +1,140 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.eclipse.aether.internal.impl; + +import java.util.HashMap; +import java.util.LinkedHashMap; + +import org.eclipse.aether.RepositorySystemSession; +import org.eclipse.aether.internal.test.util.TestUtils; +import org.eclipse.aether.repository.RemoteRepository; +import org.eclipse.aether.spi.connector.transport.Transporter; +import org.eclipse.aether.spi.connector.transport.TransporterFactory; +import org.eclipse.aether.transfer.NoTransporterException; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; + +class DefaultTransporterProviderTest { + + private static final class StubTransporterFactory implements TransporterFactory { + + private final String name; + + private final boolean canHandle; + + private final Transporter transporter; + + private int newInstanceCalls; + + private String lastProtocol; + + StubTransporterFactory(String name, boolean canHandle, Transporter transporter) { + this.name = name; + this.canHandle = canHandle; + this.transporter = transporter; + } + + @Override + public boolean canHandle(String protocol) { + lastProtocol = protocol; + return canHandle; + } + + @Override + public String getDescription() { + return name + " transporter"; + } + + @Override + public Transporter newInstance(RepositorySystemSession session, RemoteRepository repository) + throws NoTransporterException { Review Comment: test comment -- 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]
