// Path: src/main/java/com/cdancy/artifactory/rest/config/ArtifactoryAuthenticationModule.java
// public class ArtifactoryAuthenticationModule extends AbstractModule {
// 
//     private final ArtifactoryAuthentication authentication;
// 
//     public ArtifactoryAuthenticationModule(final ArtifactoryAuthentication authentication) {
//         this.authentication = Objects.requireNonNull(authentication);
//     }
// 
//     @Override
//     protected void configure() {
//         bind(ArtifactoryAuthentication.class).toProvider(new ArtifactoryAuthenticationProvider(authentication));
//     }
// }


import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.squareup.okhttp.mockwebserver.MockWebServer;
import com.squareup.okhttp.mockwebserver.RecordedRequest;
import com.cdancy.artifactory.rest.config.ArtifactoryAuthenticationModule;
import static org.assertj.core.api.Assertions.assertThat;
import static org.jclouds.util.Strings2.toStringAndClose;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
import java.util.UUID;
import javax.ws.rs.core.HttpHeaders;
import org.jclouds.Constants;
import org.jclouds.ContextBuilder;
/*
 * 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 com.cdancy.artifactory.rest;






/**
 * Base class for all Artifactory mock tests.
 */
public class BaseArtifactoryMockTest {

    protected String provider;

    public BaseArtifactoryMockTest() {
        provider = "artifactory";
    }

    public ArtifactoryApi api(URL url) {
        final ArtifactoryAuthentication creds = ArtifactoryAuthentication
                .builder()
                .credentials("hello:world")
                .build();
// Path: src/main/java/com/cdancy/artifactory/rest/config/ArtifactoryAuthenticationModule.java
// public class ArtifactoryAuthenticationModule extends AbstractModule {
// 
//     private final ArtifactoryAuthentication authentication;
// 
//     public ArtifactoryAuthenticationModule(final ArtifactoryAuthentication authentication) {
//         this.authentication = Objects.requireNonNull(authentication);
//     }
// 
//     @Override
//     protected void configure() {
//         bind(ArtifactoryAuthentication.class).toProvider(new ArtifactoryAuthenticationProvider(authentication));
//     }
// }


// Path: src/test/java/com/cdancy/artifactory/rest/BaseArtifactoryMockTest.java
import com.google.common.base.Charsets;
import com.google.common.base.Throwables;
import com.google.common.collect.Lists;
import com.squareup.okhttp.mockwebserver.MockWebServer;
import com.squareup.okhttp.mockwebserver.RecordedRequest;
import com.cdancy.artifactory.rest.config.ArtifactoryAuthenticationModule;
import static org.assertj.core.api.Assertions.assertThat;
import static org.jclouds.util.Strings2.toStringAndClose;
import java.io.IOException;
import java.net.URL;
import java.util.Properties;
import java.util.UUID;
import javax.ws.rs.core.HttpHeaders;
import org.jclouds.Constants;
import org.jclouds.ContextBuilder;

/*
 * 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 com.cdancy.artifactory.rest;






/**
 * Base class for all Artifactory mock tests.
 */
public class BaseArtifactoryMockTest {

    protected String provider;

    public BaseArtifactoryMockTest() {
        provider = "artifactory";
    }

    public ArtifactoryApi api(URL url) {
        final ArtifactoryAuthentication creds = ArtifactoryAuthentication
                .builder()
                .credentials("hello:world")
                .build();
        final ArtifactoryAuthenticationModule credsModule = new ArtifactoryAuthenticationModule(creds);