Remove pre-3.2 deprecated classes and methods
Issue: SPR-12578
This commit is contained in:
@@ -42,11 +42,13 @@ public class HttpHeadersTests {
|
||||
|
||||
private HttpHeaders headers;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
headers = new HttpHeaders();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void accept() {
|
||||
MediaType mediaType1 = new MediaType("text", "html");
|
||||
@@ -59,9 +61,7 @@ public class HttpHeadersTests {
|
||||
assertEquals("Invalid Accept header", "text/html, text/plain", headers.getFirst("Accept"));
|
||||
}
|
||||
|
||||
// SPR-9655
|
||||
|
||||
@Test
|
||||
@Test // SPR-9655
|
||||
public void acceptiPlanet() {
|
||||
headers.add("Accept", "text/html");
|
||||
headers.add("Accept", "text/plain");
|
||||
@@ -228,7 +228,7 @@ public class HttpHeadersTests {
|
||||
calendar.setTimeZone(TimeZone.getTimeZone("CET"));
|
||||
long date = calendar.getTimeInMillis();
|
||||
headers.setIfModifiedSince(date);
|
||||
assertEquals("Invalid If-Modified-Since header", date, headers.getIfNotModifiedSince());
|
||||
assertEquals("Invalid If-Modified-Since header", date, headers.getIfModifiedSince());
|
||||
assertEquals("Invalid If-Modified-Since header", "Thu, 18 Dec 2008 10:20:00 GMT",
|
||||
headers.getFirst("if-modified-since"));
|
||||
}
|
||||
@@ -260,12 +260,9 @@ public class HttpHeadersTests {
|
||||
headers.getFirst("Content-Disposition"));
|
||||
}
|
||||
|
||||
// SPR-11917
|
||||
|
||||
@Test
|
||||
@Test // SPR-11917
|
||||
public void getAllowEmptySet() {
|
||||
headers.setAllow(Collections.<HttpMethod> emptySet());
|
||||
|
||||
assertThat(headers.getAllow(), Matchers.emptyCollectionOf(HttpMethod.class));
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -30,7 +30,6 @@ public class UriUtilsTests {
|
||||
private static final String ENC = "UTF-8";
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void encodeScheme() throws UnsupportedEncodingException {
|
||||
assertEquals("Invalid encoded result", "foobar+-.", UriUtils.encodeScheme("foobar+-.", ENC));
|
||||
@@ -105,62 +104,4 @@ public class UriUtilsTests {
|
||||
UriUtils.decode("foo%2", ENC);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Deprecated
|
||||
public void encodeUri() throws UnsupportedEncodingException {
|
||||
assertEquals("Invalid encoded URI", "http://www.ietf.org/rfc/rfc3986.txt",
|
||||
UriUtils.encodeUri("http://www.ietf.org/rfc/rfc3986.txt", ENC));
|
||||
assertEquals("Invalid encoded URI", "https://www.ietf.org/rfc/rfc3986.txt",
|
||||
UriUtils.encodeUri("https://www.ietf.org/rfc/rfc3986.txt", ENC));
|
||||
assertEquals("Invalid encoded URI", "http://www.google.com/?q=Z%C3%BCrich",
|
||||
UriUtils.encodeUri("http://www.google.com/?q=Z\u00fcrich", ENC));
|
||||
assertEquals("Invalid encoded URI",
|
||||
"http://arjen:foobar@java.sun.com:80/javase/6/docs/api/java/util/BitSet.html?foo=bar#and(java.util.BitSet)",
|
||||
UriUtils.encodeUri(
|
||||
"http://arjen:foobar@java.sun.com:80/javase/6/docs/api/java/util/BitSet.html?foo=bar#and(java.util.BitSet)",
|
||||
ENC));
|
||||
assertEquals("Invalid encoded URI", "http://java.sun.com/j2se/1.3/",
|
||||
UriUtils.encodeUri("http://java.sun.com/j2se/1.3/", ENC));
|
||||
assertEquals("Invalid encoded URI", "docs/guide/collections/designfaq.html#28",
|
||||
UriUtils.encodeUri("docs/guide/collections/designfaq.html#28", ENC));
|
||||
assertEquals("Invalid encoded URI", "../../../demo/jfc/SwingSet2/src/SwingSet2.java",
|
||||
UriUtils.encodeUri("../../../demo/jfc/SwingSet2/src/SwingSet2.java", ENC));
|
||||
assertEquals("Invalid encoded URI", "file:///~/calendar", UriUtils.encodeUri("file:///~/calendar", ENC));
|
||||
assertEquals("Invalid encoded URI", "http://example.com/query=foo@bar",
|
||||
UriUtils.encodeUri("http://example.com/query=foo@bar", ENC));
|
||||
|
||||
// SPR-8974
|
||||
assertEquals("http://example.org?format=json&url=http://another.com?foo=bar",
|
||||
UriUtils.encodeUri("http://example.org?format=json&url=http://another.com?foo=bar", ENC));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Deprecated
|
||||
public void encodeHttpUrl() throws UnsupportedEncodingException {
|
||||
assertEquals("Invalid encoded HTTP URL", "http://www.ietf.org/rfc/rfc3986.txt",
|
||||
UriUtils.encodeHttpUrl("http://www.ietf.org/rfc/rfc3986.txt", ENC));
|
||||
assertEquals("Invalid encoded URI", "https://www.ietf.org/rfc/rfc3986.txt",
|
||||
UriUtils.encodeHttpUrl("https://www.ietf.org/rfc/rfc3986.txt", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL", "http://www.google.com/?q=Z%C3%BCrich",
|
||||
UriUtils.encodeHttpUrl("http://www.google.com/?q=Z\u00fcrich", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL", "http://ws.geonames.org/searchJSON?q=T%C5%8Dky%C5%8D&style=FULL&maxRows=300",
|
||||
UriUtils.encodeHttpUrl("http://ws.geonames.org/searchJSON?q=T\u014dky\u014d&style=FULL&maxRows=300", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL",
|
||||
"http://arjen:foobar@java.sun.com:80/javase/6/docs/api/java/util/BitSet.html?foo=bar",
|
||||
UriUtils.encodeHttpUrl(
|
||||
"http://arjen:foobar@java.sun.com:80/javase/6/docs/api/java/util/BitSet.html?foo=bar", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL", "http://search.twitter.com/search.atom?q=%23avatar",
|
||||
UriUtils.encodeHttpUrl("http://search.twitter.com/search.atom?q=#avatar", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL", "http://java.sun.com/j2se/1.3/",
|
||||
UriUtils.encodeHttpUrl("http://java.sun.com/j2se/1.3/", ENC));
|
||||
assertEquals("Invalid encoded HTTP URL", "http://example.com/query=foo@bar",
|
||||
UriUtils.encodeHttpUrl("http://example.com/query=foo@bar", ENC));
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Deprecated
|
||||
public void encodeHttpUrlMail() throws UnsupportedEncodingException {
|
||||
UriUtils.encodeHttpUrl("mailto:java-net@java.sun.com", ENC);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user