From 127e1955e89f39b2fc069c2cbf33f4f154f0b80d Mon Sep 17 00:00:00 2001 From: Christopher Lambert Date: Mon, 21 Nov 2022 10:15:15 +0100 Subject: [PATCH] Upgrade errorprone from 2.14.0 to 2.16 we need to fix the following violation: StubbingWithCustomAnswerTest.java:113: error: [DoNotCall] Calling getClass on Method returns the Class object for Method, you probably meant to retrieve the class containing the method represented by this Method using getDeclaringClass --- gradle/dependencies.gradle | 2 +- .../org/mockitousage/stubbing/StubbingWithCustomAnswerTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 6928e86a3c..7acca469c5 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -6,7 +6,7 @@ def versions = [:] versions.bytebuddy = '1.12.16' versions.junitJupiter = '5.9.1' -versions.errorprone = '2.14.0' +versions.errorprone = '2.16' libraries.junit4 = 'junit:junit:4.13.2' libraries.junitJupiterApi = "org.junit.jupiter:junit-jupiter-api:${versions.junitJupiter}" diff --git a/src/test/java/org/mockitousage/stubbing/StubbingWithCustomAnswerTest.java b/src/test/java/org/mockitousage/stubbing/StubbingWithCustomAnswerTest.java index 5591bc47b5..29d6846299 100644 --- a/src/test/java/org/mockitousage/stubbing/StubbingWithCustomAnswerTest.java +++ b/src/test/java/org/mockitousage/stubbing/StubbingWithCustomAnswerTest.java @@ -110,7 +110,7 @@ public void shouldMakeSureTheInterfaceDoesNotChange() throws Exception { new Answer() { public String answer(InvocationOnMock invocation) throws Throwable { assertTrue(invocation.getArguments().getClass().isArray()); - assertEquals(Method.class, invocation.getMethod().getClass()); + assertEquals(IMethods.class, invocation.getMethod().getDeclaringClass()); return "assertions passed"; }