Fix WeightRecordTest#testAggregateLocalFilter_yearPeriod test for android14-tests-dev am: 49de50915b am: 5cabd8ebc0

Original change: https://android-review.googlesource.com/c/platform/packages/modules/HealthFitness/+/2779487

Change-Id: Id25628a9c670e626c7f34e839a7825c8097e7217
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java b/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
index 9e8012c..ed79478 100644
--- a/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
+++ b/tests/cts/src/android/healthconnect/cts/WeightRecordTest.java
@@ -706,28 +706,28 @@
     }
 
     @Test
-    public void testAggregateLocalFilter_yearPeriod() throws Exception {
+    public void testAggregateLocalFilter_daysPeriod() throws Exception {
         LocalDateTime endTimeLocal = LocalDateTime.now(ZoneOffset.UTC);
         Instant endTimeInstant = Instant.now();
-
         TestUtils.insertRecords(
                 List.of(
                         new WeightRecord.Builder(
-                                        TestUtils.generateMetadata(),
-                                        endTimeInstant.minus(400, ChronoUnit.DAYS),
-                                        Mass.fromGrams(10.0))
+                                TestUtils.generateMetadata(),
+                                endTimeInstant.minus(20, ChronoUnit.DAYS),
+                                Mass.fromGrams(10.0))
                                 .setZoneOffset(ZoneOffset.MIN)
                                 .build()));
+
         List<AggregateRecordsGroupedByPeriodResponse<Mass>> responses =
                 TestUtils.getAggregateResponseGroupByPeriod(
                         new AggregateRecordsRequest.Builder<Mass>(
-                                        new LocalTimeRangeFilter.Builder()
-                                                .setStartTime(endTimeLocal.minusYears(2))
-                                                .setEndTime(endTimeLocal)
-                                                .build())
+                                new LocalTimeRangeFilter.Builder()
+                                        .setStartTime(endTimeLocal.minusDays(30))
+                                        .setEndTime(endTimeLocal)
+                                        .build())
                                 .addAggregationType(WEIGHT_MAX)
                                 .build(),
-                        Period.ofYears(1));
+                        Period.ofDays(15));
 
         assertThat(responses).hasSize(2);
         assertThat(responses.get(0).get(WEIGHT_MAX)).isEqualTo(Mass.fromGrams(10.0));