Merge branch '2.0.x' into 2.1.x
Closes gh-17078
This commit is contained in:
@@ -34,8 +34,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-yahoo-client-id",
|
||||
"YAHOO-CLIENT-SECRET=my-yahoo-client-secret" })
|
||||
"YAHOO-CLIENT-ID=my-yahoo-client-id", "YAHOO-CLIENT-SECRET=my-yahoo-client-secret" })
|
||||
public class SampleOAuth2ClientApplicationTests {
|
||||
|
||||
@LocalServerPort
|
||||
@@ -48,14 +47,12 @@ public class SampleOAuth2ClientApplicationTests {
|
||||
public void everythingShouldRedirectToLogin() {
|
||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.FOUND);
|
||||
assertThat(entity.getHeaders().getLocation())
|
||||
.isEqualTo(URI.create("http://localhost:" + this.port + "/login"));
|
||||
assertThat(entity.getHeaders().getLocation()).isEqualTo(URI.create("http://localhost:" + this.port + "/login"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void loginShouldHaveAllOAuth2ClientsToChooseFrom() {
|
||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/login",
|
||||
String.class);
|
||||
ResponseEntity<String> entity = this.restTemplate.getForEntity("/login", String.class);
|
||||
assertThat(entity.getStatusCode()).isEqualTo(HttpStatus.OK);
|
||||
assertThat(entity.getBody()).contains("/oauth2/authorization/yahoo");
|
||||
assertThat(entity.getBody()).contains("/oauth2/authorization/github-client-1");
|
||||
|
||||
Reference in New Issue
Block a user