-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.3] Optimized testReadByte of FastJson2SerializationTest #15289
base: 3.3
Are you sure you want to change the base?
Conversation
eg.
it's output could be read as byte. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 3.3 #15289 +/- ##
=========================================
Coverage 60.77% 60.77%
- Complexity 10896 10917 +21
=========================================
Files 1885 1886 +1
Lines 86087 86122 +35
Branches 12896 12902 +6
=========================================
+ Hits 52317 52343 +26
Misses 28321 28321
- Partials 5449 5458 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I think this is not our test problem. Maybe it's a FastJson2 issue. |
it seems that fastjson2 could take byte value from seconds or minutes timestamp, ObjectReaderImplByte#readJSONBObject will call JSONReaderJSONB#readInt32Value0 and return int32Value's byteValue.
see details at https://github.com/alibaba/fastjson2/blob/main/core/src/main/java/com/alibaba/fastjson2/JSONReaderJSONB.java#L3625 |
d4425f6
to
bb4373f
Compare
changed the date variable type at FastJson2SerializationTest#testReadByte from Date to LocalDate, because fastjson2 will support readMillis as int32, see details at alibaba/fastjson2@f5c0b62 |
How about wait for Fastjson2 release? |
FastJson2SerializationTest#testReadByte will always fail with the new version of Fastjson2 to be released because it will treat all Date types as byte type no matter the milliseconds part is zero or not. |
What is the purpose of the change?
the milliseconds of variable date that used by testReadByte should not be zero, otherwise the output could be read as byte which will cause
Assertions.assertThrows(IOException.class, objectInput::readByte)
failure.Checklist