Skip to content
Merged
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 @@ -71,6 +71,7 @@
import io.restassured.specification.RequestSpecification;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Timeout;

/**
* This test requires doing some work on the server to add/get/delete tasks, and enqueue events. This is exposed via REST,
Expand Down Expand Up @@ -622,6 +623,7 @@ public void testSendMessageStreamExistingTaskSuccess() throws Exception {
}

@Test
@Timeout(value = 3, unit = TimeUnit.MINUTES)
public void testResubscribeExistingTaskSuccess() throws Exception {
ExecutorService executorService = Executors.newSingleThreadExecutor();
saveTaskInTaskStore(MINIMAL_TASK);
Expand Down Expand Up @@ -904,7 +906,7 @@ protected void saveTaskInTaskStore(Task task) throws Exception {

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
if (response.statusCode() != 200) {
throw new RuntimeException(response.statusCode() + ": Creating task failed! " + response.body());
throw new RuntimeException(String.format("Saving task failed! Status: %d, Body: %s", response.statusCode(), response.body()));
}
}

Expand All @@ -922,7 +924,7 @@ protected Task getTaskFromTaskStore(String taskId) throws Exception {
return null;
}
if (response.statusCode() != 200) {
throw new RuntimeException(response.statusCode() + ": Creating task failed! " + response.body());
throw new RuntimeException(String.format("Getting task failed! Status: %d, Body: %s", response.statusCode(), response.body()));
}
return Utils.OBJECT_MAPPER.readValue(response.body(), Task.TYPE_REFERENCE);
}
Expand Down Expand Up @@ -951,7 +953,7 @@ protected void ensureQueueForTask(String taskId) throws Exception {
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8));
if (response.statusCode() != 200) {
throw new RuntimeException(response.statusCode() + ": Deleting task failed!" + response.body());
throw new RuntimeException(String.format("Ensuring queue failed! Status: %d, Body: %s", response.statusCode(), response.body()));
}
}

Expand Down