847850277 opened a new pull request, #4348:
URL: https://github.com/apache/eventmesh/pull/4348
ISSUE #4339.
this test case code will IllegalArgumentException. I also fixed this issue
when headerParam param is Empty value object instance will cause
`java.lang.IllegalArgumentException: Can not set int field
org.apache.eventmesh.common.protocol.http.header.message.PushMessageRequestHeader.code
to null value`.
```java
private void setFiledValue(Header header, Map<String, Object> headerParam,
ProtocolKey protocolKey,
Field[] protocolKeyFields, Field headerField,
String headerFieldName) throws
IllegalAccessException {
for (Field protocolKeyField : protocolKeyFields) {
protocolKeyField.setAccessible(true);
switch (headerFieldName) {
case ProtocolKey.VERSION:
headerField.set(header,
ProtocolVersion.get(MapUtils.getString(headerParam, ProtocolKey.VERSION)));
break;
case ProtocolKey.LANGUAGE:
String language =
StringUtils.isBlank(MapUtils.getString(headerParam, ProtocolKey.LANGUAGE))
? Constants.LANGUAGE_JAVA :
MapUtils.getString(headerParam, ProtocolKey.LANGUAGE);
headerField.set(header, language);
break;
default:
String protocolKeyValue =
protocolKeyField.get(protocolKey).toString();
// Use the attribute name to compare with the key value
to achieve one-to-one correspondence and ignore case.
if (StringUtils.equalsIgnoreCase(headerFieldName,
protocolKeyValue)) {
Object value = getValue(headerParam,
protocolKeyValue);
headerField.set(header, value);
}
break;
}
}
}
```
### Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs /
not documented)
- If a feature is not applicable for documentation, explain why?
- If a feature is not documented yet in this PR, please create a followup
issue for adding the documentation
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]