Skip to content

Commit 3ed4c25

Browse files
committed
Use Runnable in functional method test
Update `MethodUtilsTest#testFindFunctionalInterfaceMethod` to validate against `Runnable#run` instead of `Consumer#accept`, and remove the now-unused `Consumer` import. This keeps the test focused on a no-arg functional interface method while preserving existing non-interface and non-functional interface assertions.
1 parent 6245ce7 commit 3ed4c25

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

microsphere-java-core/src/test/java/io/microsphere/reflect/MethodUtilsTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import java.util.EventListener;
3333
import java.util.List;
3434
import java.util.Objects;
35-
import java.util.function.Consumer;
3635
import java.util.function.Predicate;
3736

3837
import static io.microsphere.AbstractTestCase.JACOCO_AGENT_INSTRUCTED;
@@ -634,8 +633,8 @@ void testFindNearestOverriddenMethodOnObject() {
634633

635634
@Test
636635
void testFindFunctionalInterfaceMethod() {
637-
Method method = findMethod(Consumer.class, "accept", Object.class);
638-
assertEquals(method, findFunctionalInterfaceMethod(Consumer.class));
636+
Method method = findMethod(Runnable.class, "run");
637+
assertEquals(method, findFunctionalInterfaceMethod(Runnable.class));
639638

640639
// non-interface type
641640
assertNull(findFunctionalInterfaceMethod(Object.class));

0 commit comments

Comments
 (0)