Skip to content

Commit 9cb143a

Browse files
committed
fix test
1 parent f86251b commit 9cb143a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/misc_utilities/MethodComparator.java

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,24 @@
1717

1818
import com.google.common.truth.Correspondence;
1919
import java.lang.reflect.Method;
20+
import java.util.Arrays;
2021

2122
/**
22-
* A {@link Correspondence} to compare methods names and parameters in different classes. An example
23-
* usage is to make sure a child class is implementing all the methods in the non-abstract parent
24-
* class.
23+
* A {@link Correspondence} to compare methods names, parameters and return types in different
24+
* classes. An example usage is to make sure a child class is implementing all the methods in the
25+
* non-abstract parent class.
2526
*/
2627
public class MethodComparator {
2728

2829
public static final Correspondence<Method, Method> METHOD_CORRESPONDENCE =
29-
Correspondence.from(MethodComparator::compareMethods, "compare method names and parameters");
30+
Correspondence.from(
31+
MethodComparator::compareMethods, "compare method names, parameters and return types");
3032

3133
private static boolean compareMethods(Method actual, Method expected) {
3234
if (!actual.getName().equals(expected.getName())
33-
|| actual.getParameters().equals(expected.getParameters())
34-
|| actual.getModifiers() != expected.getModifiers()) {
35+
|| !Arrays.equals(actual.getParameterTypes(), expected.getParameterTypes())
36+
|| actual.getModifiers() != expected.getModifiers()
37+
|| !actual.getReturnType().equals(expected.getReturnType())) {
3538
return false;
3639
}
3740
return true;

0 commit comments

Comments
 (0)