ChannelEndpointAdapter extends AbstractEndpointAdapter { @Override public ChannelEndpoint getEndpoint() { return endpoint; } ChannelEndpointAdapter(ChannelSyncEndpointConfiguration endpointConfiguration); @Override Message handleMessageInternal(Message request); @Override ChannelEndpoint getEndpoint(); @Override ChannelSyncEndpointConfiguration getEndpointConfiguration(); void setBeanFactory(BeanFactory beanFactory);  }
@Test public void testEndpointAdapter() { final Message request = new DefaultMessage("<TestMessage><text>Hi!</text></TestMessage>"); new SimpleAsyncTaskExecutor().execute(new Runnable() { @Override public void run() { Message receivedMessage = endpointAdapter.getEndpoint().createConsumer().receive(context, endpointConfiguration.getTimeout()); Assert.assertNotNull(receivedMessage); Assert.assertEquals(receivedMessage.getPayload(), request.getPayload()); endpointAdapter.getEndpoint().createProducer().send(new DefaultMessage("OK"), context); } }); Message response = endpointAdapter.handleMessage(request); Assert.assertNotNull(response); Assert.assertEquals(response.getPayload(String.class), "OK"); }