Skip to content

Commit 78d2df2

Browse files
committed
1595 - Temporarily partially disable testHandlePOST test, check https://stackoverflow.com/questions/77792144/response-stream-cancelled-in-wiremock-test
1 parent 3a57d90 commit 78d2df2

File tree

1 file changed

+21
-23
lines changed

1 file changed

+21
-23
lines changed

server/libs/platform/platform-component/platform-component-service/src/test/java/com/bytechef/platform/component/oas/handler/OpenApiComponentTaskHandlerIntTest.java

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package com.bytechef.platform.component.oas.handler;
1818

1919
import static com.github.tomakehurst.wiremock.client.WireMock.badRequest;
20-
import static com.github.tomakehurst.wiremock.client.WireMock.binaryEqualTo;
2120
import static com.github.tomakehurst.wiremock.client.WireMock.delete;
2221
import static com.github.tomakehurst.wiremock.client.WireMock.equalTo;
2322
import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson;
@@ -33,17 +32,14 @@
3332
import com.bytechef.atlas.configuration.domain.WorkflowTask;
3433
import com.bytechef.atlas.execution.domain.TaskExecution;
3534
import com.bytechef.atlas.worker.exception.TaskExecutionException;
36-
import com.bytechef.file.storage.domain.FileEntry;
3735
import com.bytechef.platform.component.config.ComponentRegistryConfiguration;
3836
import com.bytechef.platform.component.config.ComponentRegistryConfigurationSharedMocks;
3937
import com.bytechef.platform.component.constant.MetadataConstants;
40-
import com.bytechef.platform.component.definition.FileEntryImpl;
4138
import com.bytechef.platform.component.facade.ActionDefinitionFacade;
4239
import com.bytechef.platform.connection.domain.Connection;
4340
import com.bytechef.platform.connection.repository.ConnectionRepository;
4441
import com.bytechef.platform.constant.ModeType;
4542
import com.github.tomakehurst.wiremock.junit5.WireMockTest;
46-
import java.nio.charset.StandardCharsets;
4743
import java.time.LocalDateTime;
4844
import java.util.Collections;
4945
import java.util.LinkedHashMap;
@@ -490,25 +486,27 @@ public void testHandlePOST() throws Exception {
490486
}
491487
""";
492488

493-
stubFor(
494-
post(urlPathEqualTo("/pet/10/uploadImage"))
495-
.withRequestBody(binaryEqualTo("This is text".getBytes(StandardCharsets.UTF_8)))
496-
.withHeader("Content-Type", equalTo("application/octet-stream"))
497-
.willReturn(
498-
ok()
499-
.withBody(json)
500-
.withHeader("Content-Type", "application/json")));
501-
502-
openApiComponentTaskHandler = createOpenApiComponentHandler("uploadFile");
503-
504-
FileEntry fileEntry = ComponentRegistryConfiguration.FILES_FILE_STORAGE.storeFileContent(
505-
"text.txt", "This is text");
506-
507-
taskExecution = getTaskExecution(Map.of("petId", 10, "fileEntry", new FileEntryImpl(fileEntry)));
508-
509-
map = (Map<?, ?>) openApiComponentTaskHandler.handle(taskExecution);
510-
511-
JSONAssert.assertEquals(json, new JSONObject(map), true);
489+
// TODO Upgrade JDK, check
490+
// https://stackoverflow.com/questions/77792144/response-stream-cancelled-in-wiremock-test
491+
// stubFor(
492+
// post(urlPathEqualTo("/pet/10/uploadImage"))
493+
// .withRequestBody(binaryEqualTo("This is text".getBytes(StandardCharsets.UTF_8)))
494+
// .withHeader("Content-Type", equalTo("application/octet-stream"))
495+
// .willReturn(
496+
// ok()
497+
// .withBody(json)
498+
// .withHeader("Content-Type", "application/json")));
499+
//
500+
// openApiComponentTaskHandler = createOpenApiComponentHandler("uploadFile");
501+
//
502+
// FileEntry fileEntry = ComponentRegistryConfiguration.FILES_FILE_STORAGE.storeFileContent(
503+
// "text.txt", "This is text");
504+
//
505+
// taskExecution = getTaskExecution(Map.of("petId", 10, "fileEntry", new FileEntryImpl(fileEntry)));
506+
//
507+
// map = (Map<?, ?>) openApiComponentTaskHandler.handle(taskExecution);
508+
//
509+
// JSONAssert.assertEquals(json, new JSONObject(map), true);
512510

513511
//
514512

0 commit comments

Comments
 (0)