android: Replace PowerMock with mechanism provided by newer Mockito versions

PowerMock isn't maintained anymore and causes issues with newer Java
versions.  We only used it to mock static methods, which Mockito now
supports as well.  Instead of using the try-with-resources construct,
this uses a @Before and @After method so we don't have to change all the
test methods.
This commit is contained in:
Tobias Brunner committed 2024-01-16 11:00:29 +01:00
1 parent 1cab544c75
commit 980491ebcd
3 files changed
+25 -20

No files matched your search

+1 -4
View File
@@ -49,8 +49,5 @@ dependencies {
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.10.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:3.11.2'
testImplementation 'org.powermock:powermock-core:2.0.9'
testImplementation 'org.powermock:powermock-module-junit4:2.0.9'
testImplementation 'org.powermock:powermock-api-mockito2:2.0.9'
testImplementation 'org.mockito:mockito-core:5.8.0'
}