diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-30 23:18:54 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-04-30 23:18:54 +0000 |
commit | d801b2e798a9c407819f3d49bd4f2f5d7cb09bc8 (patch) | |
tree | 263043933ad8fbf8418b5522590f22fac011da32 | |
parent | 8e734b33b28ffc11e8b65e3a3abaaf1bb8ce708c (diff) | |
parent | 6c0839dd6baccadc3a135be423505a615f41474e (diff) | |
download | HealthFitness-sdk-release.tar.gz |
Snap for 11785460 from 6c0839dd6baccadc3a135be423505a615f41474e to sdk-releasesdk-release
Change-Id: Iebb5f82c199a018e606fa1b556d557dbb6cf41c1
-rw-r--r-- | tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java b/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java index 5538d108..82a1fe17 100644 --- a/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java +++ b/tests/cts/src/android/healthconnect/cts/HealthConnectManagerTest.java @@ -1632,7 +1632,7 @@ public class HealthConnectManagerTest { StepsRecord testRecord = TestUtils.getStepsRecord(); try { - TestUtils.insertRecords(Collections.singletonList(testRecord)); + testRecord = (StepsRecord) TestUtils.insertRecord(testRecord); Assert.fail(); } catch (HealthConnectException exception) { assertThat(exception).isNotNull(); @@ -1788,8 +1788,7 @@ public class HealthConnectManagerTest { public void testGetRecordTypeInfo_InsertRecords_correctContributingPackages() throws Exception { // Insert a set of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord, // BasalMetabolicRateRecord. - List<Record> testRecords = TestUtils.getTestRecords(); - TestUtils.insertRecords(testRecords); + List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords()); // Populate expected records. This method puts empty lists as contributing packages for all // records. @@ -1849,8 +1848,7 @@ public class HealthConnectManagerTest { throws Exception { // Insert a sets of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord, // BasalMetabolicRateRecord. - List<Record> testRecords = TestUtils.getTestRecords(); - TestUtils.insertRecords(testRecords); + List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords()); // Populate expected records. This method puts empty lists as contributing packages for all // records. @@ -1914,11 +1912,9 @@ public class HealthConnectManagerTest { throws Exception { // Insert 2 sets of test records for StepRecords, ExerciseSessionRecord, HeartRateRecord, // BasalMetabolicRateRecord. - List<Record> testRecords = TestUtils.getTestRecords(); - TestUtils.insertRecords(testRecords); + List<Record> testRecords = TestUtils.insertRecords(TestUtils.getTestRecords()); - List<Record> testRecords2 = TestUtils.getTestRecords(); - TestUtils.insertRecords(testRecords2); + TestUtils.insertRecords(TestUtils.getTestRecords()); // When recordTypes are modified the appInfo also gets updated and this update happens on // a background thread. To ensure the test has the latest values for appInfo, add a wait |