INT-845 added StartupMode enum since polling consumers must not start as eagerly as event-driven consumers subscribe to their input channels
This commit is contained in:
@@ -37,6 +37,8 @@ import org.mockito.invocation.InvocationOnMock;
|
||||
import org.mockito.runners.MockitoJUnit44Runner;
|
||||
import org.mockito.stubbing.Answer;
|
||||
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
import org.springframework.integration.channel.DirectChannel;
|
||||
import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
@@ -90,6 +92,7 @@ public class SimpleWebServiceInboundGatewayTests {
|
||||
when(requestChannel.send(isA(Message.class))).thenAnswer(
|
||||
withReplyTo(replyChannel));
|
||||
when(request.getPayloadSource()).thenReturn(payloadSource);
|
||||
gateway.onApplicationEvent(new ContextRefreshedEvent(new StaticApplicationContext()));
|
||||
gateway.invoke(context);
|
||||
verify(requestChannel).send(messageWithPayload(payloadSource));
|
||||
assertTrue(output.toString().endsWith(input));
|
||||
|
||||
@@ -27,6 +27,7 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
import org.springframework.integration.endpoint.AbstractEndpoint;
|
||||
import org.springframework.integration.endpoint.EventDrivenConsumer;
|
||||
import org.springframework.integration.endpoint.PollingConsumer;
|
||||
import org.springframework.integration.endpoint.AbstractEndpoint.StartupMode;
|
||||
import org.springframework.integration.ws.MarshallingWebServiceOutboundGateway;
|
||||
import org.springframework.integration.ws.SimpleWebServiceOutboundGateway;
|
||||
import org.springframework.oxm.Marshaller;
|
||||
@@ -221,7 +222,7 @@ public class WebServiceOutboundGatewayParserTests {
|
||||
ApplicationContext context = new ClassPathXmlApplicationContext(
|
||||
"simpleWebServiceOutboundGatewayParserTests.xml", this.getClass());
|
||||
AbstractEndpoint endpoint = (AbstractEndpoint) context.getBean("gatewayWithOrderAndAutoStartupFalse");
|
||||
assertEquals(Boolean.FALSE, new DirectFieldAccessor(endpoint).getPropertyValue("autoStartup"));
|
||||
assertEquals(StartupMode.MANUAL, new DirectFieldAccessor(endpoint).getPropertyValue("startupMode"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user