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 @@ -35,6 +35,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

import io.cloudevents.CloudEvent;
Expand Down Expand Up @@ -101,8 +102,10 @@ public ProtocolTransportObject fromCloudEvent(CloudEvent cloudEvent) throws Prot
new String(cloudEvent.getData().toBytes(), Constants.DEFAULT_CHARSET),
new TypeReference<Map<String, Object>>() {
});
String requestHeader = JsonUtils.toJSONString(dataContentMap.get(CONSTANTS_KEY_HEADERS));
byte[] requestBody = JsonUtils.toJSONString(dataContentMap.get(CONSTANTS_KEY_BODY)).getBytes(StandardCharsets.UTF_8);
String requestHeader = JsonUtils.toJSONString(
Objects.requireNonNull(dataContentMap, "Headers must not be null").get(CONSTANTS_KEY_HEADERS));
byte[] requestBody = Objects.requireNonNull(
JsonUtils.toJSONString(dataContentMap.get(CONSTANTS_KEY_BODY)), "Body must not be null").getBytes(StandardCharsets.UTF_8);
Map<String, Object> requestHeaderMap = JsonUtils.parseTypeReferenceObject(requestHeader, new TypeReference<Map<String, Object>>() {
});
String requestURI = dataContentMap.get(CONSTANTS_KEY_PATH).toString();
Expand Down