Hi, with iOS 17 creation of HKWorkout
is deprecated via its init
functions and the recommendation is to use HKWorkoutBuilder
:
The problem is that I am creating this HKWorkout
object inside unit tests in order to test a service that works with such objects. And HKWorkoutBuilder
requires a HKHealthStore
which itself requires to be authenticated to be able to create HKWorkoutActivity
instances, like it would be when an app is running. But since the unit tests cannot accept the request on the HKHealthStore
I am not sure if using HKWorkoutBuilder
inside unit tests is possible.
Any ideas on how to proceed with creating HKWorkout
for unit test purposes?