package com.asana;

import org.junit.Test;

import java.io.IOException;
import java.util.Collections;

import static org.junit.Assert.assertEquals;

public class HeadersTest extends AsanaTest
{
    @Test
    public void testDefaultHeaders() throws IOException
    {
        dispatcher.registerResponse("GET", "http://app/users/me").code(200).content("{}");
        client.headers.put("key", "value");
        client.users.me().execute();
        assertEquals(dispatcher.calls.get(0).headers.get("key"), Collections.singletonList("value"));
    }

    @Test
    public void testRequestHeaders() throws IOException
    {
        dispatcher.registerResponse("GET", "http://app/users/me").code(200).content("{}");
        client.users.me().header("another_key", "another_value").execute();

        assertEquals(dispatcher.calls.get(0).headers.get("another_key"), Collections.singletonList("another_value"));
    }
}

@@ -741,36 +741,448 @@
 er(%22
-another_key%22, %22another_
+key%22, %22value%22).execute();%0A%0A        assertEquals(dispatcher.calls.get(0).headers.get(%22key%22), Collections.singletonList(%22value%22));%0A    %7D%0A%0A    @Test%0A    public void testOverridingHeaders() throws IOException%0A    %7B%0A        dispatcher.registerResponse(%22GET%22, %22http://app/users/me%22).code(200).content(%22%7B%7D%22);%0A        client.headers.put(%22key%22, %22value%22);%0A        client.headers.put(%22key2%22, %22value2%22);%0A        client.users.me().header(%22key2%22, %22
 value
+3
 %22).e
@@ -1254,19 +1254,114 @@
 et(%22
-another_
+key%22), Collections.singletonList(%22value%22));%0A        assertEquals(dispatcher.calls.get(0).headers.get(%22
 key
+2
 %22), 
@@ -1391,21 +1391,14 @@
 st(%22
-another_
 value
+3
 %22));

Add extra test