mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(stepfunctions): return the HTTP task result on the native image (#7543)
This commit is contained in:
1 parent
87c7a9ce7d
commit
68271ef6b8
5 files changed
+284
-14
No files matched your search
+33
@@ -300,6 +300,39 @@ class AslExecutorHttpInvokeTest {
|
||||
assertTrue(body.path("active").asBoolean());
|
||||
}
|
||||
|
||||
@Test
|
||||
void emptyResponseBodyStillReturnsEveryResultField() throws Exception {
|
||||
Execution execution = run("""
|
||||
{
|
||||
"StartAt": "CallHttp",
|
||||
"States": {
|
||||
"CallHttp": {
|
||||
"Type": "Task",
|
||||
"Resource": "arn:aws:states:::http:invoke",
|
||||
"Parameters": {
|
||||
"ApiEndpoint": "%s/text",
|
||||
"Method": "POST",
|
||||
"InvocationConfig": {
|
||||
"ConnectionArn": "%s"
|
||||
}
|
||||
},
|
||||
"End": true
|
||||
}
|
||||
}
|
||||
}
|
||||
""".formatted(baseUrl, connectionArn), "{}");
|
||||
|
||||
assertEquals("SUCCEEDED", execution.getStatus());
|
||||
JsonNode output = objectMapper.readTree(execution.getOutput());
|
||||
List<String> fields = new ArrayList<>();
|
||||
output.fieldNames().forEachRemaining(fields::add);
|
||||
assertEquals(List.of("StatusCode", "StatusText", "Headers", "ResponseBody"), fields);
|
||||
assertEquals(201, output.path("StatusCode").asInt());
|
||||
assertEquals("Created", output.path("StatusText").asText());
|
||||
assertTrue(output.path("Headers").path("Content-Type").isArray());
|
||||
assertTrue(output.path("ResponseBody").isNull());
|
||||
}
|
||||
|
||||
@Test
|
||||
void jsonataArgumentsSendAnExplicitNull() throws Exception {
|
||||
// AWS keeps the null in the arguments a Task is invoked with: TestState TRACE reports
|
||||
|
||||
Reference in new issue
Block a user