Use capitalized words for HeaderHttpSessionStrategy default header name

Fixes gh-173
This commit is contained in:
Vedran Pavic
2017-01-05 23:57:24 +01:00
parent 3ad0028785
commit 94fc80a8f0
5 changed files with 29 additions and 26 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 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.
@@ -65,7 +65,7 @@ public class RestMockMvcTests {
@Test
public void noSessionOnNoCredentials() throws Exception {
this.mvc.perform(get("/")).andExpect(header().doesNotExist("x-auth-token"))
this.mvc.perform(get("/")).andExpect(header().doesNotExist("X-Auth-Token"))
.andExpect(status().isUnauthorized());
}
@@ -73,13 +73,12 @@ public class RestMockMvcTests {
@Test
public void autheticatedAnnotation() throws Exception {
this.mvc.perform(get("/")).andExpect(content().string("{\"username\":\"user\"}"));
}
@Test
public void autheticatedRequestPostProcessor() throws Exception {
this.mvc.perform(get("/").with(user("user")))
.andExpect(content().string("{\"username\":\"user\"}"));
}
}

View File

@@ -40,7 +40,7 @@ public class RestTests {
private static final String AUTHORIZATION = "Authorization";
private static final String BASIC = "Basic ";
private static final String X_AUTH_TOKEN = "x-auth-token";
private static final String X_AUTH_TOKEN = "X-Auth-Token";
private RestTemplate restTemplate;