// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/HasHeaderMatcher.java
// public static Matcher<HttpHeaders> hasAllTaxiiHeaders() {
//     return allOf(
//         hasHeader("Content-Type", is("application/xml")),
//         hasHeader("Accept", is("application/xml")),
//         hasHeader("X-Taxii-Accept", is("urn:taxii.mitre.org:message:xml:1.1")),
//         hasHeader("X-TAXII-Content-Type", is("urn:taxii.mitre.org:message:xml:1.1")),
//         hasHeader("X-Taxii-Protocol", is("urn:taxii.mitre.org:protocol:https:1.0")),
//         hasHeader("X-TAXII-Services", is("urn:taxii.mitre.org:services:1.1"))
//     );
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/HasHeaderMatcher.java
// public static Matcher<HttpHeaders> hasUserAgentHeader() {
//     return allOf(
//             hasHeader("User-Agent", is("taxii-log-adapter-UNKNOWN"))
//     );
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/httpclient/HttpHeadersAppender.java
// public class HttpHeadersAppender {
// 
//     public void appendTo(HttpHeaders headers) {
//         headers.setContentType(MediaType.APPLICATION_XML);
//         headers.setAccept(ImmutableList.of(MediaType.APPLICATION_XML));
//         headers.set("X-Taxii-Accept", "urn:taxii.mitre.org:message:xml:1.1");
//         headers.set("X-TAXII-Content-Type", "urn:taxii.mitre.org:message:xml:1.1");
//         headers.set("X-Taxii-Protocol", "urn:taxii.mitre.org:protocol:https:1.0");
//         headers.set("X-TAXII-Services", "urn:taxii.mitre.org:services:1.1");
//         headers.set("User-Agent", "taxii-log-adapter-" + Version.getImplVersion());
//     }
// 
// }


import static com.cisco.cta.taxii.adapter.httpclient.HasHeaderMatcher.hasAllTaxiiHeaders;
import static com.cisco.cta.taxii.adapter.httpclient.HasHeaderMatcher.hasUserAgentHeader;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpHeaders;
import com.cisco.cta.taxii.adapter.httpclient.HttpHeadersAppender;
/*
   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;




public class HttpHeadersAppenderTest {

    private HttpHeadersAppender appender;
    private HttpHeaders headers;

    @Before
    public void setUp() throws Exception {
        appender = new HttpHeadersAppender();
        headers = new HttpHeaders();
    }

    @Test
    public void appendHeaders() throws Exception {
        appender.appendTo(headers);
        assertThat(headers, hasAllTaxiiHeaders());
// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/HasHeaderMatcher.java
// public static Matcher<HttpHeaders> hasAllTaxiiHeaders() {
//     return allOf(
//         hasHeader("Content-Type", is("application/xml")),
//         hasHeader("Accept", is("application/xml")),
//         hasHeader("X-Taxii-Accept", is("urn:taxii.mitre.org:message:xml:1.1")),
//         hasHeader("X-TAXII-Content-Type", is("urn:taxii.mitre.org:message:xml:1.1")),
//         hasHeader("X-Taxii-Protocol", is("urn:taxii.mitre.org:protocol:https:1.0")),
//         hasHeader("X-TAXII-Services", is("urn:taxii.mitre.org:services:1.1"))
//     );
// }
// 
// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/HasHeaderMatcher.java
// public static Matcher<HttpHeaders> hasUserAgentHeader() {
//     return allOf(
//             hasHeader("User-Agent", is("taxii-log-adapter-UNKNOWN"))
//     );
// }
// 
// Path: src/main/java/com/cisco/cta/taxii/adapter/httpclient/HttpHeadersAppender.java
// public class HttpHeadersAppender {
// 
//     public void appendTo(HttpHeaders headers) {
//         headers.setContentType(MediaType.APPLICATION_XML);
//         headers.setAccept(ImmutableList.of(MediaType.APPLICATION_XML));
//         headers.set("X-Taxii-Accept", "urn:taxii.mitre.org:message:xml:1.1");
//         headers.set("X-TAXII-Content-Type", "urn:taxii.mitre.org:message:xml:1.1");
//         headers.set("X-Taxii-Protocol", "urn:taxii.mitre.org:protocol:https:1.0");
//         headers.set("X-TAXII-Services", "urn:taxii.mitre.org:services:1.1");
//         headers.set("User-Agent", "taxii-log-adapter-" + Version.getImplVersion());
//     }
// 
// }


// Path: src/test/java/com/cisco/cta/taxii/adapter/httpclient/HttpHeadersAppenderTest.java
import static com.cisco.cta.taxii.adapter.httpclient.HasHeaderMatcher.hasAllTaxiiHeaders;
import static com.cisco.cta.taxii.adapter.httpclient.HasHeaderMatcher.hasUserAgentHeader;
import static org.junit.Assert.assertThat;
import org.junit.Before;
import org.junit.Test;
import org.springframework.http.HttpHeaders;
import com.cisco.cta.taxii.adapter.httpclient.HttpHeadersAppender;

/*
   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;




public class HttpHeadersAppenderTest {

    private HttpHeadersAppender appender;
    private HttpHeaders headers;

    @Before
    public void setUp() throws Exception {
        appender = new HttpHeadersAppender();
        headers = new HttpHeaders();
    }

    @Test
    public void appendHeaders() throws Exception {
        appender.appendTo(headers);
        assertThat(headers, hasAllTaxiiHeaders());
        assertThat(headers, hasUserAgentHeader());