Merge branch '2.0.x' into 2.1.x

Closes gh-17078
This commit is contained in:
Andy Wilkinson
2019-06-07 10:50:34 +01:00
2691 changed files with 27746 additions and 46049 deletions

View File

@@ -29,8 +29,7 @@ import static org.assertj.core.api.Assertions.assertThat;
@RunWith(SpringRunner.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = { "APP-CLIENT-ID=my-client-id", "APP-CLIENT-SECRET=my-client-secret",
"YAHOO-CLIENT-ID=my-google-client-id",
"YAHOO-CLIENT-SECRET=my-google-client-secret" })
"YAHOO-CLIENT-ID=my-google-client-id", "YAHOO-CLIENT-SECRET=my-google-client-secret" })
public class SampleReactiveOAuth2ClientApplicationTests {
@Autowired
@@ -38,14 +37,14 @@ public class SampleReactiveOAuth2ClientApplicationTests {
@Test
public void everythingShouldRedirectToLogin() {
this.webTestClient.get().uri("/").exchange().expectStatus().isFound()
.expectHeader().valueEquals("Location", "/login");
this.webTestClient.get().uri("/").exchange().expectStatus().isFound().expectHeader().valueEquals("Location",
"/login");
}
@Test
public void loginShouldHaveBothOAuthClientsToChooseFrom() {
byte[] body = this.webTestClient.get().uri("/login").exchange().expectStatus()
.isOk().returnResult(String.class).getResponseBodyContent();
byte[] body = this.webTestClient.get().uri("/login").exchange().expectStatus().isOk().returnResult(String.class)
.getResponseBodyContent();
String bodyString = new String(body);
assertThat(bodyString).contains("/oauth2/authorization/yahoo");
assertThat(bodyString).contains("/oauth2/authorization/github-client-1");