-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spring Integration 7.0 to 7.1 Migration Guide
Glenn Renfro edited this page Feb 2, 2026
·
5 revisions
Spring Integration 7.1 has updated the TestUtils.getPropertyValue() method to use generic type inference instead of requiring an explicit Class parameter.
The three-parameter method signature: public static @Nullable T getPropertyValue(Object root, String propertyPath, Class type) has been deprecated in favor of the two-parameter generic method: public static @Nullable T getPropertyValue(Object root, String propertyPath)
Old code (deprecated):
LoadBalancingStrategy strategy = TestUtils.getPropertyValue(channel, "dispatcher.loadBalancingStrategy", LoadBalancingStrategy.class);Boolean autoStartup = TestUtils.getPropertyValue(adapter, "autoStartup", Boolean.class);
New code (recommended): Option 1: Type inference with variable assignment (preferred when possible)
LoadBalancingStrategy strategy = TestUtils.getPropertyValue(channel, "dispatcher.loadBalancingStrategy");Boolean autoStartup = TestUtils.getPropertyValue(adapter, "autoStartup");
Option 2: Explicit generic type parameter (required in some contexts like assertions);
assertThat(TestUtils.<LoadBalancingStrategy>getPropertyValue(channel, "dispatcher.loadBalancingStrategy")) .isNotNull();Iterator<BlockingQueueConsumer> iterator = TestUtils.<Set<BlockingQueueConsumer>>getPropertyValue(this.channel, "container.consumers") .iterator();