-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from Asana/update-2018-07-23
Support headers, clean up 402s, remove API key
- Loading branch information
Showing
17 changed files
with
122 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
package com.asana.models; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
public class Team extends Resource { | ||
public String name; | ||
|
||
public Workspace organization; | ||
|
||
public String description; | ||
@SerializedName("html_description") | ||
public String htmlDescription; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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("key", "value").execute(); | ||
|
||
assertEquals(dispatcher.calls.get(0).headers.get("key"), Collections.singletonList("value")); | ||
} | ||
|
||
@Test | ||
public void testOverridingHeaders() throws IOException | ||
{ | ||
dispatcher.registerResponse("GET", "http://app/users/me").code(200).content("{}"); | ||
client.headers.put("key", "value"); | ||
client.headers.put("key2", "value2"); | ||
client.users.me().header("key2", "value3").execute(); | ||
|
||
assertEquals(dispatcher.calls.get(0).headers.get("key"), Collections.singletonList("value")); | ||
assertEquals(dispatcher.calls.get(0).headers.get("key2"), Collections.singletonList("value3")); | ||
} | ||
} |