diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagArgumentResolver.java index 891bc7a49..02674acb0 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/support/ETagArgumentResolver.java @@ -16,8 +16,6 @@ package org.springframework.data.rest.webmvc.support; -import static org.springframework.http.HttpHeaders.*; - import org.springframework.core.MethodParameter; import org.springframework.web.bind.support.WebDataBinderFactory; import org.springframework.web.context.request.NativeWebRequest; @@ -48,6 +46,6 @@ public class ETagArgumentResolver implements HandlerMethodArgumentResolver { @Override public ETag resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer, NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { - return ETag.from(webRequest.getHeader(IF_MATCH)); + return ETag.from(webRequest.getHeader("If-Match")); } } diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/jpa/JpaWebTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/jpa/JpaWebTests.java index 927533333..f404f7134 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/jpa/JpaWebTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/jpa/JpaWebTests.java @@ -18,7 +18,6 @@ package org.springframework.data.rest.webmvc.jpa; import static org.hamcrest.Matchers.*; import static org.junit.Assert.*; import static org.springframework.data.rest.webmvc.util.TestUtils.*; -import static org.springframework.http.HttpHeaders.*; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; @@ -38,7 +37,6 @@ import org.springframework.data.rest.core.mapping.ResourceMappings; import org.springframework.data.rest.webmvc.CommonWebTests; import org.springframework.hateoas.Link; import org.springframework.hateoas.RelProvider; -import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.mock.web.MockHttpServletResponse; import org.springframework.test.context.ContextConfiguration; @@ -588,12 +586,12 @@ public class JpaWebTests extends CommonWebTests { mvc.perform( patch(builder.build().toUriString()).content("{ \"saleItem\" : \"SpringyBurritos\" }") - .contentType(MediaType.APPLICATION_JSON).header(IF_MATCH, concurrencyTag)).andExpect( + .contentType(MediaType.APPLICATION_JSON).header("If-Match", concurrencyTag)).andExpect( status().is2xxSuccessful()); mvc.perform( patch(builder.build().toUriString()).content("{ \"saleItem\" : \"SpringyTequila\" }") - .contentType(MediaType.APPLICATION_JSON).header(IF_MATCH, "\"falseETag\"")).andExpect( + .contentType(MediaType.APPLICATION_JSON).header("If-Match", "\"falseETag\"")).andExpect( status().isPreconditionFailed()); } diff --git a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/mongodb/MongoWebTests.java b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/mongodb/MongoWebTests.java index 5b954e2b1..ee8ef89b7 100644 --- a/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/mongodb/MongoWebTests.java +++ b/spring-data-rest-webmvc/src/test/java/org/springframework/data/rest/webmvc/mongodb/MongoWebTests.java @@ -193,12 +193,12 @@ public class MongoWebTests extends CommonWebTests { mvc.perform( patch(builder.build().toUriString()).content("{ \"saleItem\" : \"SpringyBurritos\" }") - .contentType(MediaType.APPLICATION_JSON).header(IF_MATCH, concurrencyTag)).andExpect( + .contentType(MediaType.APPLICATION_JSON).header("If-Match", concurrencyTag)).andExpect( status().is2xxSuccessful()); mvc.perform( patch(builder.build().toUriString()).content("{ \"saleItem\" : \"SpringyTequila\" }") - .contentType(MediaType.APPLICATION_JSON).header(IF_MATCH, concurrencyTag)).andExpect( + .contentType(MediaType.APPLICATION_JSON).header("If-Match", concurrencyTag)).andExpect( status().isPreconditionFailed()); }