Commit 46bd004e by reckter Committed by Johannes Edmeier

Fix error in creating RestTemplate

The RestTamplateBuilder doesn't save the arguments, it returns a new Builder instance, with the saved arguments. So you have to save the builder everytime you call a function on it.
parent 848d77bf
......@@ -47,9 +47,9 @@ public class SpringBootAdminClientAutoConfiguration {
@Bean
@ConditionalOnMissingBean
public ApplicationRegistrator registrator() {
builder.messageConverters(new MappingJackson2HttpMessageConverter());
builder = builder.messageConverters(new MappingJackson2HttpMessageConverter());
if (admin.getUsername() != null) {
builder.basicAuthorization(admin.getUsername(), admin.getPassword());
builder = builder.basicAuthorization(admin.getUsername(), admin.getPassword());
}
return new ApplicationRegistrator(builder.build(), admin, client);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment