From 21e1df7247c95b0f57c1e935f7840c89f801814a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:33:59 +0000 Subject: [PATCH 1/3] Initial plan From bd7138ab22d5ff20b006adc215d072724c609bd7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:37:43 +0000 Subject: [PATCH 2/3] Fix flaky AddressRepositoryIT tests - order-sensitive assertions and ambiguous findById Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com> --- .../repository/integration/AddressRepositoryIT.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java index e76518ac9384..b89b6aabff53 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java +++ b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java @@ -86,11 +86,11 @@ public void setUp() { @Test public void testFindById() { - // test findById (ID id) cross partition - final Address result = repository.findById(TEST_ADDRESS1_PARTITION1.getPostalCode()).get(); + // test findById (ID id) cross partition using a postal code that is unique across all test addresses + final Address result = repository.findById(TEST_ADDRESS1_PARTITION2.getPostalCode()).get(); assertThat(responseDiagnosticsTestUtils.getCosmosResponseStatistics()).isNotNull(); assertThat(responseDiagnosticsTestUtils.getCosmosDiagnostics().toString().contains("\"requestOperationType\":\"Query\"")).isTrue(); - assertThat(result).isEqualTo(TEST_ADDRESS1_PARTITION1); + assertThat(result).isEqualTo(TEST_ADDRESS1_PARTITION2); } @Test @@ -150,7 +150,7 @@ public void testFindByPostalCodeAndCityIn() { final List
result = TestUtils.toList(repository.findByPostalCodeInAndCity(postalCodes, city)); assertThat(result.size()).isEqualTo(2); - assertThat(result).isEqualTo(Lists.newArrayList(TEST_ADDRESS1_PARTITION1, TEST_ADDRESS2_PARTITION1)); + assertThat(result).containsExactlyInAnyOrder(TEST_ADDRESS1_PARTITION1, TEST_ADDRESS2_PARTITION1); } @Test @@ -371,8 +371,8 @@ public void testFindAllByStreetNotNull() { TestConstants.POSTAL_CODE, null, TestConstants.CITY); final List
result = TestUtils.toList(repository.findAllByStreetNotNull()); assertThat(result.size()).isEqualTo(4); - assertThat(result).isEqualTo(Lists.newArrayList(TEST_ADDRESS1_PARTITION1, TEST_ADDRESS1_PARTITION2, - TEST_ADDRESS2_PARTITION1, TEST_ADDRESS4_PARTITION3)); + assertThat(result).containsExactlyInAnyOrder(TEST_ADDRESS1_PARTITION1, TEST_ADDRESS1_PARTITION2, + TEST_ADDRESS2_PARTITION1, TEST_ADDRESS4_PARTITION3); } From 788e79b33479cc0ba496271caa516bd054a06894 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 24 Feb 2026 01:20:12 +0000 Subject: [PATCH 3/3] Remove unused TEST_ADDRESS_TEMP variables from testFindAllByStreetNotNull and testCountByStreetNotNull Co-authored-by: kushagraThapar <14034156+kushagraThapar@users.noreply.github.com> --- .../cosmos/repository/integration/AddressRepositoryIT.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java index b89b6aabff53..38e26fa28fc3 100644 --- a/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java +++ b/sdk/spring/azure-spring-data-cosmos/src/test/java/com/azure/spring/data/cosmos/repository/integration/AddressRepositoryIT.java @@ -367,8 +367,6 @@ public void testFindTopByOrderByStreetDesc() { @Test public void testFindAllByStreetNotNull() { - Address TEST_ADDRESS_TEMP = new Address( - TestConstants.POSTAL_CODE, null, TestConstants.CITY); final List
result = TestUtils.toList(repository.findAllByStreetNotNull()); assertThat(result.size()).isEqualTo(4); assertThat(result).containsExactlyInAnyOrder(TEST_ADDRESS1_PARTITION1, TEST_ADDRESS1_PARTITION2, @@ -393,8 +391,6 @@ public void testFindTop3ByOrderByStreetDesc() { @Test public void testCountByStreetNotNull() { - Address TEST_ADDRESS_TEMP = new Address( - TestConstants.POSTAL_CODE, null, TestConstants.CITY); final Long result = repository.countByStreetNotNull(); assertThat(result).isEqualTo(4); }