Skip to content

Commit

Permalink
fix CI error: protocol mesh message
Browse files Browse the repository at this point in the history
  • Loading branch information
horoc committed Nov 3, 2022
1 parent 1618f4a commit 973f3b9
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import java.util.Map;

import io.cloudevents.CloudEvent;

import com.google.common.base.Preconditions;

public class MeshMessageProtocolAdaptor implements ProtocolAdaptor<ProtocolTransportObject> {
Expand Down Expand Up @@ -113,7 +114,9 @@ public List<CloudEvent> toBatchCloudEvent(ProtocolTransportObject protocol) thro
@Override
public ProtocolTransportObject fromCloudEvent(CloudEvent cloudEvent) throws ProtocolHandleException {
validateCloudEvent(cloudEvent);
String protocolDesc = cloudEvent.getExtension(Constants.PROTOCOL_DESC) == null ? null : cloudEvent.getExtension(Constants.PROTOCOL_DESC).toString();
String protocolDesc =
cloudEvent.getExtension(Constants.PROTOCOL_DESC) == null ? null :
cloudEvent.getExtension(Constants.PROTOCOL_DESC).toString();

if (StringUtils.equals(MeshMessageProtocolConstant.PROTOCOL_DESC_HTTP, protocolDesc)) {
HttpCommand httpCommand = new HttpCommand();
Expand All @@ -122,7 +125,7 @@ public ProtocolTransportObject fromCloudEvent(CloudEvent cloudEvent) throws Prot

@Override
public Map<String, Object> toMap() {
if(cloudEvent.getData() == null){
if (cloudEvent.getData() == null) {
return map;
}
map.put(MeshMessageProtocolConstant.PROTOCOL_KEY_CONTENT, new String(cloudEvent.getData().toBytes(), StandardCharsets.UTF_8));
Expand Down

0 comments on commit 973f3b9

Please sign in to comment.