Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public Task getTask(TaskQueryParams taskQueryParams, @Nullable ClientCallContext
try {
StringBuilder url = new StringBuilder(Utils.buildBaseUrl(agentInterface, taskQueryParams.tenant()));
if (taskQueryParams.historyLength() != null && taskQueryParams.historyLength() > 0) {
url.append(String.format("/tasks/%1s?historyLength=%2d", taskQueryParams.id(), taskQueryParams.historyLength()));
url.append(String.format("/tasks/%s?historyLength=%d", taskQueryParams.id(), taskQueryParams.historyLength()));
} else {
url.append(String.format("/tasks/%1s", taskQueryParams.id()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,14 +189,15 @@ public void testGetTask() throws Exception {
request()
.withMethod("GET")
.withPath("/tasks/de38c76d-d54c-436c-8b9f-4c2703648d64")
.withQueryStringParameter("historyLength", "5")
)
.respond(
response()
.withStatusCode(200)
.withBody(GET_TASK_TEST_RESPONSE)
);
ClientCallContext context = null;
TaskQueryParams request = new TaskQueryParams("de38c76d-d54c-436c-8b9f-4c2703648d64", 10);
TaskQueryParams request = new TaskQueryParams("de38c76d-d54c-436c-8b9f-4c2703648d64", 5);
RestTransport instance = new RestTransport(CARD);
Task task = instance.getTask(request, context);
assertEquals("de38c76d-d54c-436c-8b9f-4c2703648d64", task.id());
Expand Down
Loading