feat(types): map additional post fields#1668
Conversation
|
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR extends the Post model with four new Graph API fields: backdatedTime, coordinates (a new nested type), isFbLiveVideos, and subscribed. A new Coordinates class holds checkin and location metadata. Tests and JSON fixtures validate deserialization and absence handling. ChangesPost Model Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/test/java/com/restfb/types/PostTest.java`:
- Around line 281-303: Add a complementary negative test to cover
absence/malformed mappings: create a new test (e.g.,
checkMissingPostFields_absence) in PostTest that deserializes a JSON fixture
with those fields omitted/malformed (similar to
jsonFromClasspath("post-missing-fields") but without the optional keys), then
assert that optional object fields (examplePost.getBackdatedTime(),
examplePost.getCoordinates(), coordinates.getCoords()) are null, that optional
Boolean/primitive flags (examplePost.getIsFbLiveVideos(),
examplePost.getSubscribed()) are false or null as appropriate, and that
collections (coordinates.getTaggedUids()) are empty or null; use the same unique
symbols (examplePost, Post.Coordinates, getBackdatedTime, getIsFbLiveVideos,
getSubscribed, getCoordinates, getCoords, getTaggedUids) so the assertions
mirror the happy-path test but verify null/default handling for the
absence/failure path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b6433131-ac1e-4b7e-8d12-26c7fea37727
📒 Files selected for processing (3)
src/main/lombok/com/restfb/types/Post.javasrc/test/java/com/restfb/types/PostTest.javasrc/test/resources/json/post-missing-fields.json
Summary
Verification
Summary by CodeRabbit