|
1 | 1 | /*
|
2 |
| - * Copyright 2014-2016 the original author or authors. |
| 2 | + * Copyright 2014-2018 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
69 | 69 | import org.springframework.context.annotation.ComponentScan;
|
70 | 70 | import org.springframework.context.annotation.Configuration;
|
71 | 71 | import org.springframework.context.annotation.ImportResource;
|
| 72 | +import org.springframework.context.expression.EnvironmentAccessor; |
| 73 | +import org.springframework.context.expression.MapAccessor; |
72 | 74 | import org.springframework.core.convert.converter.Converter;
|
73 | 75 | import org.springframework.core.serializer.support.SerializingConverter;
|
74 | 76 | import org.springframework.expression.EvaluationContext;
|
| 77 | +import org.springframework.expression.spel.support.ReflectivePropertyAccessor; |
75 | 78 | import org.springframework.integration.annotation.Aggregator;
|
76 | 79 | import org.springframework.integration.annotation.BridgeFrom;
|
77 | 80 | import org.springframework.integration.annotation.BridgeTo;
|
@@ -694,7 +697,11 @@ public void testSourcePollingChannelAdapterOutputChannelLateBinding() {
|
694 | 697 | public void testIntegrationEvaluationContextCustomization() {
|
695 | 698 | EvaluationContext evaluationContext = this.context.getBean(EvaluationContext.class);
|
696 | 699 | List<?> propertyAccessors = TestUtils.getPropertyValue(evaluationContext, "propertyAccessors", List.class);
|
| 700 | + assertEquals(4, propertyAccessors.size()); |
697 | 701 | assertThat(propertyAccessors.get(0), instanceOf(JsonPropertyAccessor.class));
|
| 702 | + assertThat(propertyAccessors.get(1), instanceOf(EnvironmentAccessor.class)); |
| 703 | + assertThat(propertyAccessors.get(2), instanceOf(MapAccessor.class)); |
| 704 | + assertThat(propertyAccessors.get(3), instanceOf(ReflectivePropertyAccessor.class)); |
698 | 705 | Map<?, ?> variables = TestUtils.getPropertyValue(evaluationContext, "variables", Map.class);
|
699 | 706 | Object testSpelFunction = variables.get("testSpelFunction");
|
700 | 707 | assertEquals(ClassUtils.getStaticMethod(TestSpelFunction.class, "bar", Object.class), testSpelFunction);
|
@@ -1109,7 +1116,7 @@ public SpelFunctionFactoryBean testSpelFunction() {
|
1109 | 1116 |
|
1110 | 1117 | @Bean
|
1111 | 1118 | public SpelPropertyAccessorRegistrar spelPropertyAccessorRegistrar() {
|
1112 |
| - return new SpelPropertyAccessorRegistrar(new JsonPropertyAccessor()); |
| 1119 | + return new SpelPropertyAccessorRegistrar(new JsonPropertyAccessor(), new EnvironmentAccessor()); |
1113 | 1120 | }
|
1114 | 1121 |
|
1115 | 1122 | }
|
|
0 commit comments