|
1 | 1 | /*
|
2 |
| - * Copyright 2014-2017 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;
|
@@ -705,7 +708,11 @@ public void testSourcePollingChannelAdapterOutputChannelLateBinding() {
|
705 | 708 | public void testIntegrationEvaluationContextCustomization() {
|
706 | 709 | EvaluationContext evaluationContext = this.context.getBean(EvaluationContext.class);
|
707 | 710 | List<?> propertyAccessors = TestUtils.getPropertyValue(evaluationContext, "propertyAccessors", List.class);
|
| 711 | + assertEquals(4, propertyAccessors.size()); |
708 | 712 | assertThat(propertyAccessors.get(0), instanceOf(JsonPropertyAccessor.class));
|
| 713 | + assertThat(propertyAccessors.get(1), instanceOf(EnvironmentAccessor.class)); |
| 714 | + assertThat(propertyAccessors.get(2), instanceOf(MapAccessor.class)); |
| 715 | + assertThat(propertyAccessors.get(3), instanceOf(ReflectivePropertyAccessor.class)); |
709 | 716 | Map<?, ?> variables = TestUtils.getPropertyValue(evaluationContext, "variables", Map.class);
|
710 | 717 | Object testSpelFunction = variables.get("testSpelFunction");
|
711 | 718 | assertEquals(ClassUtils.getStaticMethod(TestSpelFunction.class, "bar", Object.class), testSpelFunction);
|
@@ -1112,7 +1119,7 @@ public SpelFunctionFactoryBean testSpelFunction() {
|
1112 | 1119 |
|
1113 | 1120 | @Bean
|
1114 | 1121 | public SpelPropertyAccessorRegistrar spelPropertyAccessorRegistrar() {
|
1115 |
| - return new SpelPropertyAccessorRegistrar(new JsonPropertyAccessor()); |
| 1122 | + return new SpelPropertyAccessorRegistrar(new JsonPropertyAccessor(), new EnvironmentAccessor()); |
1116 | 1123 | }
|
1117 | 1124 |
|
1118 | 1125 | }
|
|
0 commit comments