Merge branch '2.0.x' into 2.1.x
Closes gh-17078
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2018 the original author or authors.
|
||||
* Copyright 2012-2019 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.
|
||||
@@ -71,8 +71,7 @@ public class SampleOauth2ResourceServerApplicationTests {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setBearerAuth(VALID_TOKEN);
|
||||
HttpEntity<?> request = new HttpEntity<Void>(headers);
|
||||
ResponseEntity<String> entity = this.restTemplate.exchange("/", HttpMethod.GET,
|
||||
request, String.class);
|
||||
ResponseEntity<String> entity = this.restTemplate.exchange("/", HttpMethod.GET, request, String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -80,8 +79,7 @@ public class SampleOauth2ResourceServerApplicationTests {
|
||||
public void withNoBearerTokenShouldNotAllowAccess() {
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
HttpEntity<?> request = new HttpEntity<Void>(headers);
|
||||
ResponseEntity<String> entity = this.restTemplate.exchange("/", HttpMethod.GET,
|
||||
request, String.class);
|
||||
ResponseEntity<String> entity = this.restTemplate.exchange("/", HttpMethod.GET, request, String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.UNAUTHORIZED);
|
||||
}
|
||||
|
||||
@@ -103,8 +101,7 @@ public class SampleOauth2ResourceServerApplicationTests {
|
||||
+ "V9gWuOzSJ0iEuWvtQ6eGBP5M6m7pccLNZfwUse8Cb4Ngx3XiTlyuqM7pv0LPyppZusfEHVEdeelou7Dy9k0OQ_nJTI3b2E1WBoHC5"
|
||||
+ "8CJ453lo4gcBm1efURN3LIVc1V9NQY_ESBKVdwqYyoJPEanURLVGRd6cQKn6YrCbbIRHjqAyqOE-z3KmgDJnPriljfR5XhSGyM9eq"
|
||||
+ "D9Xpy6zu_MAeMJJfSArp857zLPk-Wf5VP9STAcjyfdBIybMKnwBYr2qHMT675hQ\"}]}";
|
||||
return new MockResponse()
|
||||
.setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
|
||||
return new MockResponse().setHeader(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE)
|
||||
.setResponseCode(200).setBody(body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user