From 106642a8d4ff655f8d841574d3dc2c6df7961f76 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 29 Dec 2017 14:48:24 +0100 Subject: [PATCH] Polish --- ...AbstractReactiveWebServerFactoryTests.java | 4 +-- .../SpringProfileDocumentMatcherTests.java | 25 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java index b9d4cb5766d..3d58a95bf35 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java @@ -88,12 +88,12 @@ public abstract class AbstractReactiveWebServerFactoryTests { } @Test - public void basicSslFromClassPath() throws Exception { + public void basicSslFromClassPath() { testBasicSslWithKeyStore("classpath:test.jks"); } @Test - public void basicSslFromFileSystem() throws Exception { + public void basicSslFromFileSystem() { testBasicSslWithKeyStore("src/test/resources/test.jks"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/yaml/SpringProfileDocumentMatcherTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/yaml/SpringProfileDocumentMatcherTests.java index b284927d934..8fbbc19cd68 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/yaml/SpringProfileDocumentMatcherTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/yaml/SpringProfileDocumentMatcherTests.java @@ -16,7 +16,6 @@ package org.springframework.boot.yaml; -import java.io.IOException; import java.util.Properties; import org.junit.Test; @@ -37,42 +36,42 @@ import static org.assertj.core.api.Assertions.assertThat; public class SpringProfileDocumentMatcherTests { @Test - public void matchesSingleProfile() throws IOException { + public void matchesSingleProfile() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.ProfILEs: foo"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void abstainNoConfiguredProfiles() throws IOException { + public void abstainNoConfiguredProfiles() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("some.property: spam"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.ABSTAIN); } @Test - public void noActiveProfiles() throws IOException { + public void noActiveProfiles() { DocumentMatcher matcher = new SpringProfileDocumentMatcher(); Properties properties = getProperties("spring.profiles: bar,spam"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND); } @Test - public void matchesCommaSeparatedString() throws IOException { + public void matchesCommaSeparatedString() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.profiles: bar,spam"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void matchesCommaSeparatedArray() throws IOException { + public void matchesCommaSeparatedArray() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.profiles: [bar, spam]"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void matchesList() throws IOException { + public void matchesList() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties( String.format("spring.profiles:%n - bar%n - spam")); @@ -80,42 +79,42 @@ public class SpringProfileDocumentMatcherTests { } @Test - public void noMatchingProfiles() throws IOException { + public void noMatchingProfiles() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.profiles: baz,blah"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND); } @Test - public void inverseMatchSingle() throws IOException { + public void inverseMatchSingle() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.profiles: '!baz'"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void testInverseMatchMulti() throws IOException { + public void testInverseMatchMulti() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar"); Properties properties = getProperties("spring.profiles: '!baz,!blah'"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void negatedWithMatch() throws Exception { + public void negatedWithMatch() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah"); Properties properties = getProperties("spring.profiles: '!baz,blah'"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.FOUND); } @Test - public void negatedWithNoMatch() throws IOException { + public void negatedWithNoMatch() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "bar", "blah"); Properties properties = getProperties("spring.profiles: '!baz,another'"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND); } @Test - public void negatedTrumpsMatching() throws IOException { + public void negatedTrumpsMatching() { DocumentMatcher matcher = new SpringProfileDocumentMatcher("foo", "baz", "blah"); Properties properties = getProperties("spring.profiles: '!baz,blah'"); assertThat(matcher.matches(properties)).isEqualTo(MatchStatus.NOT_FOUND);