From 69ace01640166bad7b8c9b8f8f1e792f8d1486f5 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 7 Dec 2012 12:26:27 +0100 Subject: [PATCH] Clean up warnings in spring-test - Deleted unused imports. - Switched from junit.framework.Assert to org.junit.Assert, since the former is deprecated as of JUnit 4.11. - Suppressed warnings for continued deprecated usage of junit.framework.Assert. --- .../test/web/client/response/MockRestResponseCreators.java | 4 ---- .../test/context/expression/ExpressionUsageTests.java | 4 ++-- .../context/junit38/FailingBeforeAndAfterMethodsTests.java | 2 ++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/spring-test-mvc/src/main/java/org/springframework/test/web/client/response/MockRestResponseCreators.java b/spring-test-mvc/src/main/java/org/springframework/test/web/client/response/MockRestResponseCreators.java index 088d2560dc..d1137e8f2f 100644 --- a/spring-test-mvc/src/main/java/org/springframework/test/web/client/response/MockRestResponseCreators.java +++ b/spring-test-mvc/src/main/java/org/springframework/test/web/client/response/MockRestResponseCreators.java @@ -15,15 +15,11 @@ */ package org.springframework.test.web.client.response; -import java.io.IOException; import java.net.URI; import org.springframework.core.io.Resource; -import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.http.client.ClientHttpRequest; -import org.springframework.mock.http.client.MockClientHttpResponse; import org.springframework.test.web.client.ResponseCreator; /** diff --git a/spring-test/src/test/java/org/springframework/test/context/expression/ExpressionUsageTests.java b/spring-test/src/test/java/org/springframework/test/context/expression/ExpressionUsageTests.java index 723a3c1c08..94d44e0e13 100644 --- a/spring-test/src/test/java/org/springframework/test/context/expression/ExpressionUsageTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/expression/ExpressionUsageTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ package org.springframework.test.context.expression; -import static junit.framework.Assert.assertEquals; +import static org.junit.Assert.assertEquals; import java.util.Properties; diff --git a/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java b/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java index 319fee93c8..3049204efb 100644 --- a/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java +++ b/spring-test/src/test/java/org/springframework/test/context/junit38/FailingBeforeAndAfterMethodsTests.java @@ -92,6 +92,7 @@ public class FailingBeforeAndAfterMethodsTests { static class AlwaysFailingBeforeTestMethodTestExecutionListener extends AbstractTestExecutionListener { @Override + @SuppressWarnings("deprecation") public void beforeTestMethod(TestContext testContext) { junit.framework.Assert.fail("always failing beforeTestMethod()"); } @@ -100,6 +101,7 @@ public class FailingBeforeAndAfterMethodsTests { static class AlwaysFailingAfterTestMethodTestExecutionListener extends AbstractTestExecutionListener { @Override + @SuppressWarnings("deprecation") public void afterTestMethod(TestContext testContext) { junit.framework.Assert.fail("always failing afterTestMethod()"); }