-
Notifications
You must be signed in to change notification settings - Fork 0
getEntity added #16
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
getEntity added #16
Conversation
ushios
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
こここうしたらここのエラーはなくなるかも。
Co-authored-by: Shugo USHIO <ushio.s@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds getEntity retrieval functionality to MocClient and extends the test suite to cover basic create-and-retrieve behavior.
- Introduces three overloaded getEntity methods in MocClient that wrap retrieveEntityWithResponseSpec.
- Adds a minimal integration-style test to verify entity creation and retrieval.
- Imports RetrieveEntityResponse and asserts ID integrity in the new test.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/main/java/city/makeour/moc/MocClient.java | Added three overloaded getEntity helper methods wrapping entity retrieval. |
| src/test/java/city/makeour/moc/MocClientTest.java | Added a new test for minimal create + get flow using the new API. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| } | ||
|
|
||
| public ResponseSpec getEntity(String entityId, String type, String attrs, String metadata, String options) { | ||
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, "keyValues"); |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The options parameter is ignored and 'keyValues' is hard-coded, causing any caller-supplied options value to be silently dropped. Either pass options through or remove the parameter if only 'keyValues' is supported.
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, "keyValues"); | |
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, options); |
| public ResponseSpec getEntity(String entityId, String type, String attrs, String metadata, String options) { | ||
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, "keyValues"); | ||
| } | ||
|
|
||
| public ResponseSpec getEntity(String entityId, String type, String attrs) { | ||
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, null, "keyValues"); | ||
| } | ||
|
|
||
| public ResponseSpec getEntity(String entityId, String type) { | ||
| return this.entities().retrieveEntityWithResponseSpec(entityId, type, null, null, "keyValues"); |
Copilot
AI
Oct 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The literal 'keyValues' is duplicated across all overloads. Consider extracting it to a named constant (e.g., DEFAULT_RETRIEVE_OPTIONS) to avoid repetition and ease future changes.
ushios
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
おっけーです!
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
getEntityの追加と、MocClientTestの拡張をしました。