// Path: src/main/java/com/cisco/cta/taxii/adapter/settings/ProxySettings.java
// @ConfigurationProperties(prefix="proxy")
// @Data
// public class ProxySettings {
// 
//     private URL url;
// 
//     private ProxyAuthenticationType authenticationType;
// 
//     private String domain;
// 
//     private String username;
// 
//     private String password;
// 
//     private String workstation;
// 
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/settings/TaxiiServiceSettings.java
// @ConfigurationProperties(prefix="taxii-service")
// @Data
// @Validated
// public class TaxiiServiceSettings {
// 
//     private static final Charset UTF8 = Charset.forName("UTF-8");
// 
//     @NotNull
//     private URL pollEndpoint;
// 
//     @NotNull
//     private String username;
// 
//     @NotNull
//     private String password;
// 
//     private List<String> feeds;
// 
//     private File feedNamesFile;
// 
//     private File statusFile = new File("taxii-status.xml");
// 
//     @PostConstruct
//     public void loadFeedNames() throws IOException {
//         Preconditions.checkState(
//             feeds != null ^ feedNamesFile != null,
//             "taxii-service.feeds or taxii-service.feedNamesFile must be set");
//         if (feedNamesFile != null) {
//             feeds = Files.readLines(feedNamesFile, UTF8);
//         }
//     }
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/settings/TaxiiServiceSettingsFactory.java
// public class TaxiiServiceSettingsFactory {
// 
//     public static TaxiiServiceSettings createDefaults() {
//         try {
//             TaxiiServiceSettings connSettings = new TaxiiServiceSettings();
//             connSettings.setPollEndpoint(new URL("http://localhost:8080/service"));
//             connSettings.setUsername("user");
//             connSettings.setPassword("pass");
//             return connSettings;
//         } catch (MalformedURLException e) {
//             throw new RuntimeException(e);
//         }
//     }
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/IsEventContaining.java
// public static void verifyLog(Appender<ILoggingEvent> mockAppender, final String substring) {
//     verify(mockAppender, atLeastOnce())
//             .doAppend(argThat(isEventContaining(substring)));
// }


import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.core.Appender;
import com.cisco.cta.taxii.adapter.settings.ProxySettings;
import com.cisco.cta.taxii.adapter.settings.TaxiiServiceSettings;
import com.cisco.cta.taxii.adapter.settings.TaxiiServiceSettingsFactory;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.protocol.RequestAuthCache;
import org.apache.http.conn.HttpHostConnectException;
import org.apache.http.impl.client.HttpClients;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpRequestFactory;
import javax.net.ServerSocketFactory;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.SocketTimeoutException;
import static com.cisco.cta.taxii.adapter.IsEventContaining.verifyLog;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;
/*
   Copyright 2015 Cisco Systems

   Licensed 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.cisco.cta.taxii.adapter.httpclient;





@SuppressWarnings("all")
public class BasicAuthHttpRequestFactoryTest {

    private ClientHttpRequestFactory factory;
    private HttpClient httpClient;
// Path: src/main/java/com/cisco/cta/taxii/adapter/settings/ProxySettings.java
// @ConfigurationProperties(prefix="proxy")
// @Data
// public class ProxySettings {
// 
//     private URL url;
// 
//     private ProxyAuthenticationType authenticationType;
// 
//     private String domain;
// 
//     private String username;
// 
//     private String password;
// 
//     private String workstation;
// 
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/settings/TaxiiServiceSettings.java
// @ConfigurationProperties(prefix="taxii-service")
// @Data
// @Validated
// public class TaxiiServiceSettings {
// 
//     private static final Charset UTF8 = Charset.forName("UTF-8");
// 
//     @NotNull
//     private URL pollEndpoint;
// 
//     @NotNull
//     private String username;
// 
//     @NotNull
//     private String password;
// 
//     private List<String> feeds;
// 
//     private File feedNamesFile;
// 
//     private File statusFile = new File("taxii-status.xml");
// 
//     @PostConstruct
//     public void loadFeedNames() throws IOException {
//         Preconditions.checkState(
//             feeds != null ^ feedNamesFile != null,
//             "taxii-service.feeds or taxii-service.feedNamesFile must be set");
//         if (feedNamesFile != null) {
//             feeds = Files.readLines(feedNamesFile, UTF8);
//         }
//     }
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/settings/TaxiiServiceSettingsFactory.java
// public class TaxiiServiceSettingsFactory {
// 
//     public static TaxiiServiceSettings createDefaults() {
//         try {
//             TaxiiServiceSettings connSettings = new TaxiiServiceSettings();
//             connSettings.setPollEndpoint(new URL("http://localhost:8080/service"));
//             connSettings.setUsername("user");
//             connSettings.setPassword("pass");
//             return connSettings;
//         } catch (MalformedURLException e) {
//             throw new RuntimeException(e);
//         }
//     }
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/IsEventContaining.java
// public static void verifyLog(Appender<ILoggingEvent> mockAppender, final String substring) {
//     verify(mockAppender, atLeastOnce())
//             .doAppend(argThat(isEventContaining(substring)));
// }


// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/BasicAuthHttpRequestFactoryTest.java
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.core.Appender;
import com.cisco.cta.taxii.adapter.settings.ProxySettings;
import com.cisco.cta.taxii.adapter.settings.TaxiiServiceSettings;
import com.cisco.cta.taxii.adapter.settings.TaxiiServiceSettingsFactory;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.protocol.RequestAuthCache;
import org.apache.http.conn.HttpHostConnectException;
import org.apache.http.impl.client.HttpClients;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
import org.slf4j.LoggerFactory;
import org.springframework.http.HttpMethod;
import org.springframework.http.client.ClientHttpRequest;
import org.springframework.http.client.ClientHttpRequestFactory;
import javax.net.ServerSocketFactory;
import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.SocketTimeoutException;
import static com.cisco.cta.taxii.adapter.IsEventContaining.verifyLog;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.when;

/*
   Copyright 2015 Cisco Systems

   Licensed 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.cisco.cta.taxii.adapter.httpclient;





@SuppressWarnings("all")
public class BasicAuthHttpRequestFactoryTest {

    private ClientHttpRequestFactory factory;
    private HttpClient httpClient;
    private TaxiiServiceSettings connSettings;