Polish
This commit is contained in:
parent
f036a89c77
commit
106642a8d4
|
@ -88,12 +88,12 @@ public abstract class AbstractReactiveWebServerFactoryTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void basicSslFromClassPath() throws Exception {
|
public void basicSslFromClassPath() {
|
||||||
testBasicSslWithKeyStore("classpath:test.jks");
|
testBasicSslWithKeyStore("classpath:test.jks");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void basicSslFromFileSystem() throws Exception {
|
public void basicSslFromFileSystem() {
|
||||||
testBasicSslWithKeyStore("src/test/resources/test.jks");
|
testBasicSslWithKeyStore("src/test/resources/test.jks");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package org.springframework.boot.yaml;
|
package org.springframework.boot.yaml;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -37,42 +36,42 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||||
public class SpringProfileDocumentMatcherTests {
|
public class SpringProfileDocumentMatcherTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void matchesSingleProfile() throws IOException {
|
public void matchesSingleProfile() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.ProfILEs: foo");
|
Properties properties = getProperties("spring.ProfILEs: foo");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void abstainNoConfiguredProfiles() throws IOException {
|
public void abstainNoConfiguredProfiles() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("some.property: spam");
|
Properties properties = getProperties("some.property: spam");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.ABSTAIN);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.ABSTAIN);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void noActiveProfiles() throws IOException {
|
public void noActiveProfiles() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher();
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher();
|
||||||
Properties properties = getProperties("spring.profiles: bar,spam");
|
Properties properties = getProperties("spring.profiles: bar,spam");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void matchesCommaSeparatedString() throws IOException {
|
public void matchesCommaSeparatedString() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.profiles: bar,spam");
|
Properties properties = getProperties("spring.profiles: bar,spam");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void matchesCommaSeparatedArray() throws IOException {
|
public void matchesCommaSeparatedArray() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.profiles: [bar, spam]");
|
Properties properties = getProperties("spring.profiles: [bar, spam]");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void matchesList() throws IOException {
|
public void matchesList() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties(
|
Properties properties = getProperties(
|
||||||
String.format("spring.profiles:%n - bar%n - spam"));
|
String.format("spring.profiles:%n - bar%n - spam"));
|
||||||
|
@ -80,42 +79,42 @@ public class SpringProfileDocumentMatcherTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void noMatchingProfiles() throws IOException {
|
public void noMatchingProfiles() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.profiles: baz,blah");
|
Properties properties = getProperties("spring.profiles: baz,blah");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void inverseMatchSingle() throws IOException {
|
public void inverseMatchSingle() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.profiles: '!baz'");
|
Properties properties = getProperties("spring.profiles: '!baz'");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testInverseMatchMulti() throws IOException {
|
public void testInverseMatchMulti() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar");
|
||||||
Properties properties = getProperties("spring.profiles: '!baz,!blah'");
|
Properties properties = getProperties("spring.profiles: '!baz,!blah'");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void negatedWithMatch() throws Exception {
|
public void negatedWithMatch() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah");
|
||||||
Properties properties = getProperties("spring.profiles: '!baz,blah'");
|
Properties properties = getProperties("spring.profiles: '!baz,blah'");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void negatedWithNoMatch() throws IOException {
|
public void negatedWithNoMatch() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah");
|
||||||
Properties properties = getProperties("spring.profiles: '!baz,another'");
|
Properties properties = getProperties("spring.profiles: '!baz,another'");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void negatedTrumpsMatching() throws IOException {
|
public void negatedTrumpsMatching() {
|
||||||
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "baz", "blah");
|
DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "baz", "blah");
|
||||||
Properties properties = getProperties("spring.profiles: '!baz,blah'");
|
Properties properties = getProperties("spring.profiles: '!baz,blah'");
|
||||||
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);
|
||||||
|
|
Loading…
Reference in New Issue