Skip to content

Commit

Permalink
Merge pull request #791 from citrusframework/fix/xml-bean-names
Browse files Browse the repository at this point in the history
fix: Fix bean names for legacy projects
  • Loading branch information
christophd authored Aug 9, 2021
2 parents 0f71904 + a0d8ec1 commit 5acdc80
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ protected AbstractBeanDefinition parseInternal(Element element, ParserContext pa
BeanDefinitionBuilder configurationBuilder = BeanDefinitionBuilder.genericBeanDefinition(getEndpointConfigurationClass());
parseEndpointConfiguration(configurationBuilder, element, parserContext);

endpointBuilder.addPropertyValue("name", element.getAttribute(ID_ATTRIBUTE));

String endpointConfigurationId = element.getAttribute(ID_ATTRIBUTE) + "Configuration";
BeanDefinitionParserUtils.registerBean(endpointConfigurationId, configurationBuilder.getBeanDefinition(), parserContext, shouldFireEvents());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public void testHttpClientParser() {

// 1st message sender
HttpClient httpClient = clients.get("httpClient1");
Assert.assertEquals(httpClient.getName(), "httpClient1");
Assert.assertNotNull(httpClient.getEndpointConfiguration().getRestTemplate());
Assert.assertEquals(httpClient.getEndpointConfiguration().getRequestUrl(), "http://localhost:8080/test");
Assert.assertEquals(httpClient.getEndpointConfiguration().getRestTemplate().getRequestFactory().getClass(), InterceptingClientHttpRequestFactory.class);
Expand Down

0 comments on commit 5acdc80

Please sign in to comment.