}
@Test
public void testOverwriteEndpointComponent() throws Exception {
Map<String, EndpointComponent> components = new HashMap<String, EndpointComponent>();
components.put("jms", new ChannelEndpointComponent());
reset(applicationContext);
expect(applicationContext.getBeansOfType(EndpointComponent.class)).andReturn(components).once();
expect(applicationContext.getBean(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME, HeaderChannelRegistry.class))
.andThrow(new NoSuchBeanDefinitionException(IntegrationContextUtils.INTEGRATION_HEADER_CHANNEL_REGISTRY_BEAN_NAME)).once();