Skip to content

Commit

Permalink
Update Chat API endpoint follow new pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
hieudion committed Oct 23, 2024
1 parent 1fb24b3 commit 7ab6900
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class Url
public static final String API_OBJECT_RECORD = "api/sunshine/objects/records";
public static final String API_RELATIONSHIP_RECORD = "api/sunshine/relationships/records";
public static final String API_USER_EVENT = "api/v2/users/%s/events";
public static final String API_CHAT = API + "/chats";
public static final String API_CHAT = API + "/chat/chats";
public static final String API_CHAT_SEARCH = API_CHAT + "/search";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ public void testFetchData()
JsonNode dataSearchJson = ZendeskTestHelper.getJsonFromFile("data/chat_search.json");
JsonNode dataJson = ZendeskTestHelper.getJsonFromFile("data/chat.json");

when(zendeskRestClient.doGet(eq("https://www.chat.zendesk.com/api/v2/chats/search?q=timestamp%3A%5B2018-09-15T05%3A00%3A00Z+TO+2019-09-29T05%3A00%3A00Z%5D&page=1"), any(), anyBoolean())).thenReturn(dataSearchJson.toString());
when(zendeskRestClient.doGet(eq("https://www.chat.zendesk.com/api/v2/chat/chats/search?q=timestamp%3A%5B2018-09-15T05%3A00%3A00Z+TO+2019-09-29T05%3A00%3A00Z%5D&page=1"), any(), anyBoolean())).thenReturn(dataSearchJson.toString());

when(zendeskRestClient.doGet(eq("https://www.chat.zendesk.com/api/v2/chats?ids=id_1%2Cid_2"), any(), anyBoolean())).thenReturn(dataJson.toString());
when(zendeskRestClient.doGet(eq("https://www.chat.zendesk.com/api/v2/chat/chats?ids=id_1%2Cid_2"), any(), anyBoolean())).thenReturn(dataJson.toString());

zendeskChatService.fetchData("2018-09-15T05:00:00Z", "2019-09-29T05:00:00Z", 1, recordImporter);

Expand Down

0 comments on commit 7ab6900

Please sign in to comment.