use of org.springframework.integration.http.inbound.CrossOrigin in project spring-integration by spring-projects.
the class WebFluxInboundGatewayParserTests method reactiveFullConfig.
@Test
@SuppressWarnings("unchecked")
public void reactiveFullConfig() {
DirectFieldAccessor endpointAccessor = new DirectFieldAccessor(this.reactiveFullConfig);
assertSame(this.requests, endpointAccessor.getPropertyValue("requestChannel"));
assertNotNull(endpointAccessor.getPropertyValue("errorChannel"));
assertFalse((boolean) endpointAccessor.getPropertyValue("autoStartup"));
assertEquals(101, endpointAccessor.getPropertyValue("phase"));
assertTrue((boolean) endpointAccessor.getPropertyValue("expectReply"));
assertEquals("'504'", ((SpelExpression) endpointAccessor.getPropertyValue("statusCodeExpression")).getExpressionString());
assertEquals("payload", ((SpelExpression) endpointAccessor.getPropertyValue("payloadExpression")).getExpressionString());
Map<String, Expression> headerExpressions = (Map<String, Expression>) endpointAccessor.getPropertyValue("headerExpressions");
assertTrue(headerExpressions.containsKey("foo"));
assertEquals("foo", headerExpressions.get("foo").getValue());
CrossOrigin crossOrigin = (CrossOrigin) endpointAccessor.getPropertyValue("crossOrigin");
assertNotNull(crossOrigin);
assertArrayEquals(new String[] { "foo" }, crossOrigin.getOrigin());
assertEquals(ResolvableType.forClass(byte[].class), endpointAccessor.getPropertyValue("requestPayloadType"));
assertSame(this.headerMapper, endpointAccessor.getPropertyValue("headerMapper"));
assertSame(this.serverCodecConfigurer, endpointAccessor.getPropertyValue("codecConfigurer"));
assertSame(this.requestedContentTypeResolver, endpointAccessor.getPropertyValue("requestedContentTypeResolver"));
assertSame(this.reactiveAdapterRegistry, endpointAccessor.getPropertyValue("adapterRegistry"));
}
use of org.springframework.integration.http.inbound.CrossOrigin in project spring-integration by spring-projects.
the class WebFluxInboundChannelAdapterParserTests method reactiveFullConfig.
@Test
@SuppressWarnings("unchecked")
public void reactiveFullConfig() {
DirectFieldAccessor endpointAccessor = new DirectFieldAccessor(this.reactiveFullConfig);
assertSame(this.requests, endpointAccessor.getPropertyValue("requestChannel"));
assertNotNull(endpointAccessor.getPropertyValue("errorChannel"));
assertFalse((boolean) endpointAccessor.getPropertyValue("autoStartup"));
assertEquals(101, endpointAccessor.getPropertyValue("phase"));
assertFalse((boolean) endpointAccessor.getPropertyValue("expectReply"));
assertEquals("'202'", ((SpelExpression) endpointAccessor.getPropertyValue("statusCodeExpression")).getExpressionString());
assertEquals("payload", ((SpelExpression) endpointAccessor.getPropertyValue("payloadExpression")).getExpressionString());
Map<String, Expression> headerExpressions = (Map<String, Expression>) endpointAccessor.getPropertyValue("headerExpressions");
assertTrue(headerExpressions.containsKey("foo"));
assertEquals("foo", headerExpressions.get("foo").getValue());
CrossOrigin crossOrigin = (CrossOrigin) endpointAccessor.getPropertyValue("crossOrigin");
assertNotNull(crossOrigin);
assertArrayEquals(new String[] { "foo" }, crossOrigin.getOrigin());
assertEquals(ResolvableType.forClass(byte[].class), endpointAccessor.getPropertyValue("requestPayloadType"));
assertSame(this.headerMapper, endpointAccessor.getPropertyValue("headerMapper"));
assertSame(this.serverCodecConfigurer, endpointAccessor.getPropertyValue("codecConfigurer"));
assertSame(this.requestedContentTypeResolver, endpointAccessor.getPropertyValue("requestedContentTypeResolver"));
assertSame(this.reactiveAdapterRegistry, endpointAccessor.getPropertyValue("adapterRegistry"));
}
Aggregations