From 27ab9332c1a1f1ea791348a094bb70b79207681e Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Mon, 6 Jan 2014 12:15:52 +0100 Subject: [PATCH] Suppress deprecation warning for MHSR.setStatus() Suppressing deprecation warnings for MockHttpServletResponse.setStatus(int, String). --- .../mock/web/MockHttpServletResponseTests.java | 14 +++++++++----- .../servlet/result/PrintingResultHandlerTests.java | 3 ++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java index 904440b4a5..55bb66b36d 100644 --- a/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java +++ b/spring-test/src/test/java/org/springframework/mock/web/MockHttpServletResponseTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -19,6 +19,7 @@ package org.springframework.mock.web; import java.io.IOException; import java.util.Arrays; import java.util.Collection; + import javax.servlet.http.HttpServletResponse; import org.junit.Test; @@ -221,8 +222,9 @@ public class MockHttpServletResponseTests { assertEquals(redirectUrl, response.getRedirectedUrl()); } - // SPR-10414 - + /** + * SPR-10414 + */ @Test public void modifyStatusAfterSendError() throws IOException { response.sendError(HttpServletResponse.SC_NOT_FOUND); @@ -230,9 +232,11 @@ public class MockHttpServletResponseTests { assertEquals(response.getStatus(),HttpServletResponse.SC_NOT_FOUND); } - // SPR-10414 - + /** + * SPR-10414 + */ @Test + @SuppressWarnings("deprecation") public void modifyStatusMessageAfterSendError() throws IOException { response.sendError(HttpServletResponse.SC_NOT_FOUND); response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Server Error"); diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java index 5902cb5e94..6fd8bba409 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/result/PrintingResultHandlerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2014 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. @@ -92,6 +92,7 @@ public class PrintingResultHandlerTests { } @Test + @SuppressWarnings("deprecation") public void testPrintResponse() throws Exception { this.response.setStatus(400, "error"); this.response.addHeader("header", "headerValue");