Browse Source

Fix BridgeMethodResolverTests.isBridgeMethodFor() in Eclipse IDE

pull/32412/head
Sam Brannen 2 years ago
parent
commit
eab1a3dc6b
  1. 10
      spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

10
spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

@ -30,6 +30,7 @@ import java.util.concurrent.Delayed; @@ -30,6 +30,7 @@ import java.util.concurrent.Delayed;
import org.junit.jupiter.api.Test;
import org.springframework.core.testfixture.ide.IdeUtils;
import org.springframework.util.ReflectionUtils;
import static org.assertj.core.api.Assertions.assertThat;
@ -120,7 +121,14 @@ class BridgeMethodResolverTests { @@ -120,7 +121,14 @@ class BridgeMethodResolverTests {
void isBridgeMethodFor() throws Exception {
Method bridged = MyBar.class.getDeclaredMethod("someMethod", String.class, Object.class);
Method other = MyBar.class.getDeclaredMethod("someMethod", Integer.class, Object.class);
Method bridge = MyBar.class.getDeclaredMethod("someMethod", Object.class, Object.class);
Method bridge;
if (IdeUtils.runningInEclipse()) {
bridge = InterBar.class.getDeclaredMethod("someMethod", Object.class, Object.class);
}
else {
bridge = MyBar.class.getDeclaredMethod("someMethod", Object.class, Object.class);
}
assertThat(BridgeMethodResolver.isBridgeMethodFor(bridge, bridged, MyBar.class)).as("Should be bridge method").isTrue();
assertThat(BridgeMethodResolver.isBridgeMethodFor(bridge, other, MyBar.class)).as("Should not be bridge method").isFalse();

Loading…
Cancel
Save