From a4ac862b05f1a44cce9ef08580f1edd04e73f2ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 06:16:02 +0000 Subject: [PATCH 1/4] Add e2e tests for putFlattenReadOnlyModel and putFlattenUnknownModel Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/1215e2b9-da07-4404-ae9e-60a16b7f21e3 Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com> --- .../flattenproperty/FlattenClientTests.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java index eee87772a1f..b1014971e8f 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/clientgenerator/core/flattenproperty/FlattenClientTests.java @@ -6,7 +6,11 @@ import azure.clientgenerator.core.flattenproperty.models.ChildFlattenModel; import azure.clientgenerator.core.flattenproperty.models.ChildModel; import azure.clientgenerator.core.flattenproperty.models.FlattenModel; +import azure.clientgenerator.core.flattenproperty.models.FlattenUnknownModel; import azure.clientgenerator.core.flattenproperty.models.NestedFlattenModel; +import azure.clientgenerator.core.flattenproperty.models.Solution; +import azure.clientgenerator.core.flattenproperty.models.SolutionProperties; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class FlattenClientTests { @@ -19,4 +23,24 @@ public void testFlattenModel() { flattenClient.putNestedFlattenModel( new NestedFlattenModel("foo", new ChildFlattenModel("bar", new ChildModel("test", 10)))); } + + @Test + public void testPutFlattenUnknownModel() { + // flatten is ignored for unknown (non-model) type properties + FlattenUnknownModel result = flattenClient.putFlattenUnknownModel(new FlattenUnknownModel("foo")); + Assertions.assertEquals("test", result.getName()); + Assertions.assertNotNull(result.getProperties()); + } + + @Test + public void testPutFlattenReadOnlyModel() { + // flatten with all read-only properties; input only contains writable fields + Solution result = flattenClient.putFlattenReadOnlyModel(new Solution("foo")); + Assertions.assertEquals("foo", result.getName()); + SolutionProperties properties = result.getProperties(); + Assertions.assertNotNull(properties); + Assertions.assertEquals("solution1", properties.getSolutionId()); + Assertions.assertEquals("Solution Title", properties.getTitle()); + Assertions.assertEquals("Solution Content", properties.getContent()); + } } From a8204cfd4fa468db2d98773fef7c3dd25b4b138a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 06:20:57 +0000 Subject: [PATCH 2/4] Add testPageWithRelativeNextLink e2e test case Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/1cde0974-efdc-4414-b8c3-c45345f8bdd8 Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com> --- .../src/test/java/azure/core/page/PageTests.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/core/page/PageTests.java b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/core/page/PageTests.java index 8ed4b2ff6f7..65242c9c6c0 100644 --- a/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/core/page/PageTests.java +++ b/packages/http-client-java/generator/http-client-generator-test/src/test/java/azure/core/page/PageTests.java @@ -47,4 +47,9 @@ public void testPageRequestBody() { public void testPageNextLinkReInjectedParameters() { Assertions.assertEquals(2, client.withParameterizedNextLink("name", true).stream().count()); } + + @Test + public void testPageWithRelativeNextLink() { + Assertions.assertEquals(2, client.withRelativeNextLink().stream().count()); + } } From ae90694c84f031a70ccd29eb92239135a7c19ccf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 14 Apr 2026 06:28:01 +0000 Subject: [PATCH 3/4] Add changelog entry for withRelativeNextLink test case Agent-Logs-Url: https://github.com/microsoft/typespec/sessions/9fd6e30f-84e2-47ee-9871-31efd9c694b0 Co-authored-by: weidongxu-microsoft <53292327+weidongxu-microsoft@users.noreply.github.com> --- .../changes/add-test-withRelativeNextLink-2026-4-14.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .chronus/changes/add-test-withRelativeNextLink-2026-4-14.md diff --git a/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md b/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md new file mode 100644 index 00000000000..7383f128739 --- /dev/null +++ b/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md @@ -0,0 +1,8 @@ +--- +# Change versionKind to one of: internal, fix, dependencies, feature, deprecation, breaking +changeKind: feature +packages: + - "@typespec/http-client-java" +--- + +Add test case for `withRelativeNextLink` paging scenario. From 616154f304eaff90e0e38496ec6c9cfc1cc0d797 Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Tue, 14 Apr 2026 14:31:09 +0800 Subject: [PATCH 4/4] Update add-test-withRelativeNextLink-2026-4-14.md --- .chronus/changes/add-test-withRelativeNextLink-2026-4-14.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md b/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md index 7383f128739..0375df5ed14 100644 --- a/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md +++ b/.chronus/changes/add-test-withRelativeNextLink-2026-4-14.md @@ -5,4 +5,4 @@ packages: - "@typespec/http-client-java" --- -Add test case for `withRelativeNextLink` paging scenario. +Add test case for `withRelativeNextLink`, `FlattenUnknownModel`, `FlattenReadOnlyModel` scenario.