Skip to content

Conversation

@mohirose
Copy link
Contributor

getEntityの追加と、MocClientTestの拡張をしました。

@mohirose mohirose requested a review from ushios September 17, 2025 02:44
Copy link
Contributor

@ushios ushios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

こここうしたらここのエラーはなくなるかも。

mohirose and others added 2 commits October 1, 2025 11:19
@ushios ushios marked this pull request as ready for review October 8, 2025 02:03
@ushios ushios requested review from Copilot and ushios October 8, 2025 02:03
Copy link
Contributor

Copilot AI left a 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");
Copy link

Copilot AI Oct 8, 2025

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.

Suggested change
return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, "keyValues");
return this.entities().retrieveEntityWithResponseSpec(entityId, type, attrs, metadata, options);

Copilot uses AI. Check for mistakes.
Comment on lines 96 to 105
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");
Copy link

Copilot AI Oct 8, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@ushios ushios left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

おっけーです!

ushios and others added 2 commits October 8, 2025 11:07
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ushios ushios self-requested a review October 8, 2025 02:07
@ushios ushios merged commit 538b3d5 into main Oct 8, 2025
1 of 2 checks passed
@ushios ushios deleted the feature/add-get-entity branch October 8, 2025 02:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants