Merge branch '1.3.x'

This commit is contained in:
Marcin Grzejszczak
2018-01-31 15:36:49 +01:00
2 changed files with 17 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ class ZipkinSenderCondition extends SpringBootCondition {
return ConditionOutcome.match(message.because("automatic sender type"));
}
String senderType = getType(((AnnotationMetadata) md).getClassName());
if (property.equals(senderType)) {
if (property.equalsIgnoreCase(senderType)) {
return ConditionOutcome.match(message.because(property + " sender type"));
}
return ConditionOutcome.noMatch(message.because(property + " sender type"));

View File

@@ -152,6 +152,22 @@ public class ZipkinAutoConfigurationTests {
context.close();
}
@Test
public void canOverrideBySenderAndIsCaseInsensitive() throws Exception {
context = new AnnotationConfigApplicationContext();
addEnvironment(context, "spring.zipkin.sender.type:WEB");
context.register(
PropertyPlaceholderAutoConfiguration.class,
RabbitAutoConfiguration.class,
KafkaAutoConfiguration.class,
ZipkinAutoConfiguration.class);
context.refresh();
then(context.getBean(Sender.class).getClass().getName()).contains("RestTemplateSender");
context.close();
}
@Test
public void rabbitWinsWhenKafkaPresent() throws Exception {
context = new AnnotationConfigApplicationContext();