this.userAgent = userAgent;
return this;
}
+
+ @Override
+ public boolean equals( Object o )
+ {
+ if ( this == o )
+ {
+ return true;
+ }
+ if ( !( o instanceof WagonFactoryRequest ) )
+ {
+ return false;
+ }
+
+ WagonFactoryRequest that = (WagonFactoryRequest) o;
+
+ if ( protocol != null ? !protocol.equals( that.protocol ) : that.protocol != null )
+ {
+ return false;
+ }
+ if ( userAgent != null ? !userAgent.equals( that.userAgent ) : that.userAgent != null )
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ int result = protocol != null ? protocol.hashCode() : 0;
+ result = 31 * result + ( userAgent != null ? userAgent.hashCode() : 0 );
+ return result;
+ }
}
new WagonFactoryRequest( "wagon#" + protocol + "-ntlm", remoteRepository.getExtraHeaders() ) )
: wagonFactory.getWagon(
new WagonFactoryRequest( "wagon#" + protocol, remoteRepository.getExtraHeaders() ) );
- wagon = wagonFactory.getWagon(
- new WagonFactoryRequest( "wagon#" + protocol, remoteRepository.getExtraHeaders() ) );
+ if ( wagon == null )
+ {
+ wagon = wagonFactory.getWagon(
+ new WagonFactoryRequest( "wagon#" + protocol, remoteRepository.getExtraHeaders() ) );
+ }
if ( wagon == null )
{
throw new RuntimeException( "Unsupported remote repository protocol: " + protocol );
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashMap;
import java.util.List;
import static org.mockito.Mockito.mock;
storage.setWagonFactory( wagonFactory );
Wagon wagon = new MockWagon();
- when( wagonFactory.getWagon( new WagonFactoryRequest().protocol( "wagon#http" ) ) ).thenReturn( wagon );
+ when( wagonFactory.getWagon(
+ new WagonFactoryRequest( "wagon#http", new HashMap<String, String>() ) ) ).thenReturn( wagon );
}
// Tests for MRM-1411 - START
public void testGetProjectVersionMetadataWithParentSnapshotVersion()
throws Exception
{
+
copyTestArtifactWithParent( "target/test-classes/com/example/test/test-snapshot-artifact-module-a",
"target/test-repository/com/example/test/test-snapshot-artifact-module-a" );
+ //copyTestArtifactWithParent( "target/test-classes/com/example/test/test-snapshot-artifact-root",
+ // "target/test-repository/com/example/test/test-snapshot-artifact-root" );
+
ProjectVersionMetadata metadata = storage.readProjectVersionMetadata(
new ReadMetadataRequest( TEST_REPO_ID, "com.example.test", "test-snapshot-artifact-module-a",
"1.1-SNAPSHOT" ) );