Search in sources :

Example 1 with ManagementServerProperties

use of org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties in project spring-cloud-sleuth by spring-cloud.

the class SkipPatternProviderConfigTest method managementServerPropertiesWithContextPath.

private ManagementServerProperties managementServerPropertiesWithContextPath() {
    ManagementServerProperties managementServerProperties = new ManagementServerProperties();
    managementServerProperties.getServlet().setContextPath("/management/context");
    return managementServerProperties;
}
Also used : ManagementServerProperties(org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties)

Example 2 with ManagementServerProperties

use of org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties in project spring-cloud-sleuth by spring-cloud.

the class SkipPatternProviderConfigTest method should_pick_default_pattern_when_both_management_context_and_skip_patterns_are_empty.

@Test
public void should_pick_default_pattern_when_both_management_context_and_skip_patterns_are_empty() throws Exception {
    SleuthWebProperties sleuthWebProperties = new SleuthWebProperties();
    sleuthWebProperties.setSkipPattern("");
    ManagementServerProperties managementServerProperties = new ManagementServerProperties();
    managementServerProperties.getServlet().setContextPath("");
    Pattern pattern = TraceWebAutoConfiguration.SkipPatternProviderConfig.getPatternForManagementServerProperties(managementServerProperties, sleuthWebProperties);
    then(pattern.pattern()).isEqualTo(SleuthWebProperties.DEFAULT_SKIP_PATTERN);
}
Also used : Pattern(java.util.regex.Pattern) ManagementServerProperties(org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties) Test(org.junit.Test)

Example 3 with ManagementServerProperties

use of org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties in project spring-cloud-sleuth by spring-cloud.

the class SkipPatternProviderConfigTest method should_pick_skip_pattern_when_its_not_empty_and_management_context_is_empty.

@Test
public void should_pick_skip_pattern_when_its_not_empty_and_management_context_is_empty() throws Exception {
    SleuthWebProperties sleuthWebProperties = new SleuthWebProperties();
    sleuthWebProperties.setSkipPattern("foo.*|bar.*");
    Pattern pattern = TraceWebAutoConfiguration.SkipPatternProviderConfig.getPatternForManagementServerProperties(new ManagementServerProperties(), sleuthWebProperties);
    then(pattern.pattern()).isEqualTo("foo.*|bar.*");
}
Also used : Pattern(java.util.regex.Pattern) ManagementServerProperties(org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties) Test(org.junit.Test)

Example 4 with ManagementServerProperties

use of org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties in project spring-cloud-sleuth by spring-cloud.

the class SkipPatternProviderConfigTest method should_pick_skip_pattern_and_additional_pattern_when_its_not_empty_and_management_context_is_empty.

@Test
public void should_pick_skip_pattern_and_additional_pattern_when_its_not_empty_and_management_context_is_empty() throws Exception {
    SleuthWebProperties sleuthWebProperties = new SleuthWebProperties();
    sleuthWebProperties.setSkipPattern("foo.*|bar.*");
    sleuthWebProperties.setAdditionalSkipPattern("baz.*|faz.*");
    Pattern pattern = TraceWebAutoConfiguration.SkipPatternProviderConfig.getPatternForManagementServerProperties(new ManagementServerProperties(), sleuthWebProperties);
    then(pattern.pattern()).isEqualTo("foo.*|bar.*|baz.*|faz.*");
}
Also used : Pattern(java.util.regex.Pattern) ManagementServerProperties(org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties) Test(org.junit.Test)

Example 5 with ManagementServerProperties

use of org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties in project spring-cloud-sleuth by spring-cloud.

the class SkipPatternProviderConfigTest method should_pick_default_pattern_with_additional_pattern_when_both_management_context_and_skip_patterns_are_empty.

@Test
public void should_pick_default_pattern_with_additional_pattern_when_both_management_context_and_skip_patterns_are_empty() throws Exception {
    SleuthWebProperties sleuthWebProperties = new SleuthWebProperties();
    sleuthWebProperties.setSkipPattern("");
    sleuthWebProperties.setAdditionalSkipPattern("baz.*|faz.*");
    ManagementServerProperties managementServerProperties = new ManagementServerProperties();
    managementServerProperties.getServlet().setContextPath("");
    Pattern pattern = TraceWebAutoConfiguration.SkipPatternProviderConfig.getPatternForManagementServerProperties(managementServerProperties, sleuthWebProperties);
    then(pattern.pattern()).isEqualTo(SleuthWebProperties.DEFAULT_SKIP_PATTERN + "|baz.*|faz.*");
}
Also used : Pattern(java.util.regex.Pattern) ManagementServerProperties(org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties) Test(org.junit.Test)

Aggregations

ManagementServerProperties (org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties)5 Pattern (java.util.regex.Pattern)4 Test (org.junit.Test)4