Fixes for changes in SPR-15657

Fixes gh-4408
This commit is contained in:
Rob Winch
2017-06-20 16:20:22 -05:00
parent 37011720c9
commit 8130965259
7 changed files with 94 additions and 0 deletions

View File

@@ -70,7 +70,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void basicWorks() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/principal")
.exchange()
@@ -81,7 +83,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void basicWhenPasswordInvalid401() throws Exception {
this.rest
.mutate()
.filter(invalidPassword())
.build()
.get()
.uri("/principal")
.exchange()
@@ -92,7 +96,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void authorizationAdmin403() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/admin")
.exchange()
@@ -103,7 +109,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void authorizationAdmin200() throws Exception {
this.rest
.mutate()
.filter(adminCredentials())
.build()
.get()
.uri("/admin")
.exchange()
@@ -113,7 +121,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void basicMissingUser401() throws Exception {
this.rest
.mutate()
.filter(basicAuthentication("missing-user", "password"))
.build()
.get()
.uri("/admin")
.exchange()
@@ -123,7 +133,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void basicInvalidPassword401() throws Exception {
this.rest
.mutate()
.filter(invalidPassword())
.build()
.get()
.uri("/admin")
.exchange()
@@ -143,7 +155,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void sessionWorks() throws Exception {
ExchangeResult result = this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/principal")
.exchange()
@@ -165,7 +179,9 @@ public class HelloWebfluxApplicationTests {
WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
mockRest
.mutate()
.filter(exchangeMutator.perClient(withUser()))
.build()
.get()
.uri("/principal")
.exchange()
@@ -181,7 +197,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void me() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/me")
.exchange()
@@ -192,7 +210,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void monoMe() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/mono/me")
.exchange()
@@ -203,7 +223,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void principal() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/principal")
.exchange()
@@ -214,7 +236,9 @@ public class HelloWebfluxApplicationTests {
@Test
public void headers() throws Exception {
this.rest
.mutate()
.filter(robsCredentials())
.build()
.get()
.uri("/principal")
.exchange()