Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public Task_v0_3 getTask(TaskQueryParams_v0_3 taskQueryParams, @Nullable ClientC
try {
String url;
if (taskQueryParams.historyLength() > 0) {
url = agentUrl + String.format("/v1/tasks/%1s?historyLength=%2d", taskQueryParams.id(), taskQueryParams.historyLength());
url = agentUrl + String.format("/v1/tasks/%s?historyLength=%d", taskQueryParams.id(), taskQueryParams.historyLength());
} else {
url = agentUrl + String.format("/v1/tasks/%1s", taskQueryParams.id());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,15 @@ public void testGetTask() throws Exception {
request()
.withMethod("GET")
.withPath("/v1/tasks/de38c76d-d54c-436c-8b9f-4c2703648d64")
.withQueryStringParameter("historyLength", "5")
)
.respond(
response()
.withStatusCode(200)
.withBody(GET_TASK_TEST_RESPONSE)
);
ClientCallContext_v0_3 context = null;
TaskQueryParams_v0_3 request = new TaskQueryParams_v0_3("de38c76d-d54c-436c-8b9f-4c2703648d64", 10);
TaskQueryParams_v0_3 request = new TaskQueryParams_v0_3("de38c76d-d54c-436c-8b9f-4c2703648d64", 5);
RestTransport_v0_3 instance = new RestTransport_v0_3(CARD);
Task_v0_3 task = instance.getTask(request, context);
assertEquals("de38c76d-d54c-436c-8b9f-4c2703648d64", task.id());
Expand Down
Loading