expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(Collections.<String, EndpointComponent>emptyMap()).once();
expect(applicationContext.getBean(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, HeaderChannelRegistry.class))
.andThrow(new NoSuchBeanDefinitionException(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME)).once();
replay(applicationContext);
TestContext context = new TestContext();
context.setApplicationContext(applicationContext);
DefaultEndpointFactory factory = new DefaultEndpointFactory();
Endpoint endpoint = factory.create("channel:channel.name", context);
Assert.assertEquals(endpoint.getClass(), ChannelEndpoint.class);