AbstractExtendedMockitoRule: fix session leak if setup fails

Calls tearDown even if early setup of the rule fails to ensure
the MockitoSession gets closed. Otherwise every subsequent mockito
test will fail.

Bug: 296937563
Bug: 396193322
Bug: 397997489
Test: atest ExtendedMockitoRuleTest
Change-Id: I6f0c2cefa45027118afbb5f4eba2203202f30e96
2 files changed
tree: 99cc4439ee687fab93d69757a34f66b0c13e95e8
  1. build/
  2. java/
  3. javatests/
  4. tools/
  5. .gitignore
  6. Android.bp
  7. OWNERS
  8. PREUPLOAD.cfg
  9. README.md
  10. TEST_MAPPING
README.md

frameworks/libs/modules-utils/

Libraries and utilities intended for use by module and framework code.

Since modules use the code in this project, it must adhere to mainline requirements, for example, by setting min_sdk_version in Soong modules.

Java code

This project uses a single source path for Java code. All Java code should go in the java directory with subdirectories corresponding to the java package. Android.bp files should go alongside the java source files, and should only include java source for a single java package to encourage good code hygiene.

Tests for java code should go in the javatests directory and follow the same structure.