Polishing

This commit is contained in:
Juergen Hoeller
2014-12-30 21:04:28 +01:00
parent 9542313710
commit 8c700b19da
5 changed files with 248 additions and 277 deletions

View File

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

View File

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