From 055da43e30528ac5e0ad5f289cfa58996cf75109 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Sat, 7 Jan 2017 00:57:17 +0100 Subject: [PATCH] Clean up warnings in spring-test --- .../test/web/client/match/MockRestRequestMatchers.java | 4 ---- .../context/junit/jupiter/DisabledIfConditionTestCase.java | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java b/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java index ae454f2b45a..0b6b52e03af 100644 --- a/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java +++ b/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java @@ -18,8 +18,6 @@ package org.springframework.test.web.client.match; import java.io.IOException; import java.net.URI; -import java.nio.charset.Charset; -import java.util.Arrays; import java.util.List; import java.util.Map; import javax.xml.xpath.XPathExpressionException; @@ -34,9 +32,7 @@ import org.springframework.test.web.client.RequestMatcher; import org.springframework.util.Assert; import org.springframework.util.MultiValueMap; import org.springframework.web.util.UriComponentsBuilder; -import org.springframework.web.util.UriUtils; -import static java.nio.charset.StandardCharsets.UTF_8; import static org.hamcrest.MatcherAssert.*; import static org.junit.Assert.assertNotNull; import static org.springframework.test.util.AssertionErrors.*; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfConditionTestCase.java b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfConditionTestCase.java index 5d924a91f52..03cda1cbd6c 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfConditionTestCase.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit/jupiter/DisabledIfConditionTestCase.java @@ -69,7 +69,7 @@ class DisabledIfConditionTestCase { @Test void invalidExpressionEvaluationType() { String methodName = "nonBooleanOrStringExpression"; - IllegalStateException exception = expectThrows(IllegalStateException.class, + IllegalStateException exception = assertThrows(IllegalStateException.class, () -> condition.evaluate(buildExtensionContext(methodName))); Method method = ReflectionUtils.findMethod(getClass(), methodName); @@ -81,7 +81,7 @@ class DisabledIfConditionTestCase { @Test void unsupportedStringEvaluationValue() { String methodName = "stringExpressionThatIsNeitherTrueNorFalse"; - IllegalStateException exception = expectThrows(IllegalStateException.class, + IllegalStateException exception = assertThrows(IllegalStateException.class, () -> condition.evaluate(buildExtensionContext(methodName))); Method method = ReflectionUtils.findMethod(getClass(), methodName); @@ -123,7 +123,7 @@ class DisabledIfConditionTestCase { } private void assertExpressionIsBlank(String methodName) { - IllegalStateException exception = expectThrows(IllegalStateException.class, + IllegalStateException exception = assertThrows(IllegalStateException.class, () -> condition.evaluate(buildExtensionContext(methodName))); assertThat(exception.getMessage(), containsString("must not be blank"));