fix: 规范请求头的token

规范为` Authorization: Bearer $token`
This commit is contained in:
禾几海
2021-03-16 20:09:06 +08:00
parent 91a818d293
commit d248e15cea
2 changed files with 13 additions and 6 deletions

View File

@@ -219,7 +219,7 @@ public class BaseTest {
protected ResultActions getMockData(MockHttpServletRequestBuilder builder, String token, Object content) throws Exception {
// MockHttpServletRequestBuilder mockHttpServletRequestBuilder = get(url);
if (token != null) {
builder.header("Authorization", token);
builder.header("Authorization", "Bearer "+token);
}
if (content != null) {
builder.content(mapper.writeValueAsString(content)).contentType(MediaType.APPLICATION_JSON);