Reapply "Fixed DefaultMockitoSession constructor"
It was not removing the UniversalTestListener when initmocks()
failed, which would cause subsequent tests to fail because they could
not start a new session.
To test it, run the following command in a pristine device running
Android TM (without an updated adservices apk) - a lot of tests will
fail due to missing classes and methods.
$ atest AdServicesServiceCoreUnitTests 2>&1 | tee ~/tmp/log.txt && grep "Unfinished mocking session" ~/tmp/log.txt | wc
Without this patch, it would return non zero occurrences; with it, it's 0.
Test: manual verification (see above)
Bug: 140773999
Change-Id: I98389077c09af406ac46514d49d4b546b9d5690d
2 files changed