Clean up warnings in spring-test

This commit is contained in:
Sam Brannen 2017-01-07 00:57:17 +01:00
parent 87f498195c
commit 055da43e30
2 changed files with 3 additions and 7 deletions

View File

@ -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.*;

View File

@ -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"));