parent
							
								
									37011720c9
								
							
						
					
					
						commit
						8130965259
					
				| 
						 | 
					@ -89,7 +89,9 @@ public class HttpSecurityTests {
 | 
				
			||||||
		WebTestClient client = buildClient();
 | 
							WebTestClient client = buildClient();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		EntityExchangeResult<String> result = client
 | 
							EntityExchangeResult<String> result = client
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("rob", "rob"))
 | 
								.filter(basicAuthentication("rob", "rob"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/")
 | 
								.uri("/")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -68,7 +68,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWorks() throws Exception {
 | 
						public void basicWorks() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -79,7 +81,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWhenPasswordInvalid401() throws Exception {
 | 
						public void basicWhenPasswordInvalid401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -90,7 +94,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin403() throws Exception {
 | 
						public void authorizationAdmin403() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -101,7 +107,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin200() throws Exception {
 | 
						public void authorizationAdmin200() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(adminCredentials())
 | 
								.filter(adminCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -111,7 +119,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicMissingUser401() throws Exception {
 | 
						public void basicMissingUser401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("missing-user", "password"))
 | 
								.filter(basicAuthentication("missing-user", "password"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -121,7 +131,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicInvalidPassword401() throws Exception {
 | 
						public void basicInvalidPassword401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -141,7 +153,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void sessionWorks() throws Exception {
 | 
						public void sessionWorks() throws Exception {
 | 
				
			||||||
		ExchangeResult result = this.rest
 | 
							ExchangeResult result = this.rest
 | 
				
			||||||
 | 
									.mutate()
 | 
				
			||||||
				.filter(robsCredentials())
 | 
									.filter(robsCredentials())
 | 
				
			||||||
 | 
									.build()
 | 
				
			||||||
				.get()
 | 
									.get()
 | 
				
			||||||
				.uri("/principal")
 | 
									.uri("/principal")
 | 
				
			||||||
				.exchange()
 | 
									.exchange()
 | 
				
			||||||
| 
						 | 
					@ -160,7 +174,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void me() throws Exception {
 | 
						public void me() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/me")
 | 
								.uri("/me")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -171,7 +187,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void monoMe() throws Exception {
 | 
						public void monoMe() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/mono/me")
 | 
								.uri("/mono/me")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -182,7 +200,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void principal() throws Exception {
 | 
						public void principal() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -193,7 +213,9 @@ public class HelloWebfluxApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void headers() throws Exception {
 | 
						public void headers() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
									.mutate()
 | 
				
			||||||
				.filter(robsCredentials())
 | 
									.filter(robsCredentials())
 | 
				
			||||||
 | 
									.build()
 | 
				
			||||||
				.get()
 | 
									.get()
 | 
				
			||||||
				.uri("/principal")
 | 
									.uri("/principal")
 | 
				
			||||||
				.exchange()
 | 
									.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,7 +70,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWorks() throws Exception {
 | 
						public void basicWorks() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -81,7 +83,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWhenPasswordInvalid401() throws Exception {
 | 
						public void basicWhenPasswordInvalid401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -92,7 +96,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin403() throws Exception {
 | 
						public void authorizationAdmin403() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -103,7 +109,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin200() throws Exception {
 | 
						public void authorizationAdmin200() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(adminCredentials())
 | 
								.filter(adminCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -113,7 +121,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicMissingUser401() throws Exception {
 | 
						public void basicMissingUser401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("missing-user", "password"))
 | 
								.filter(basicAuthentication("missing-user", "password"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -123,7 +133,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicInvalidPassword401() throws Exception {
 | 
						public void basicInvalidPassword401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -143,7 +155,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void sessionWorks() throws Exception {
 | 
						public void sessionWorks() throws Exception {
 | 
				
			||||||
		ExchangeResult result = this.rest
 | 
							ExchangeResult result = this.rest
 | 
				
			||||||
 | 
									.mutate()
 | 
				
			||||||
				.filter(robsCredentials())
 | 
									.filter(robsCredentials())
 | 
				
			||||||
 | 
									.build()
 | 
				
			||||||
				.get()
 | 
									.get()
 | 
				
			||||||
				.uri("/principal")
 | 
									.uri("/principal")
 | 
				
			||||||
				.exchange()
 | 
									.exchange()
 | 
				
			||||||
| 
						 | 
					@ -165,7 +179,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
		WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
 | 
							WebTestClient mockRest = WebTestClient.bindToApplicationContext(this.context).webFilter(exchangeMutator).build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		mockRest
 | 
							mockRest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(exchangeMutator.perClient(withUser()))
 | 
								.filter(exchangeMutator.perClient(withUser()))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -181,7 +197,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void me() throws Exception {
 | 
						public void me() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/me")
 | 
								.uri("/me")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -192,7 +210,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void monoMe() throws Exception {
 | 
						public void monoMe() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/mono/me")
 | 
								.uri("/mono/me")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -203,7 +223,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void principal() throws Exception {
 | 
						public void principal() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -214,7 +236,9 @@ public class HelloWebfluxApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void headers() throws Exception {
 | 
						public void headers() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
									.mutate()
 | 
				
			||||||
				.filter(robsCredentials())
 | 
									.filter(robsCredentials())
 | 
				
			||||||
 | 
									.build()
 | 
				
			||||||
				.get()
 | 
									.get()
 | 
				
			||||||
				.uri("/principal")
 | 
									.uri("/principal")
 | 
				
			||||||
				.exchange()
 | 
									.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -70,7 +70,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWorks() throws Exception {
 | 
						public void basicWorks() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -81,7 +83,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWhenPasswordInvalid401() throws Exception {
 | 
						public void basicWhenPasswordInvalid401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -92,7 +96,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin403() throws Exception {
 | 
						public void authorizationAdmin403() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -103,7 +109,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin200() throws Exception {
 | 
						public void authorizationAdmin200() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(adminCredentials())
 | 
								.filter(adminCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -113,7 +121,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicMissingUser401() throws Exception {
 | 
						public void basicMissingUser401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("missing-user", "password"))
 | 
								.filter(basicAuthentication("missing-user", "password"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -123,7 +133,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicInvalidPassword401() throws Exception {
 | 
						public void basicInvalidPassword401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -143,7 +155,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void sessionWorks() throws Exception {
 | 
						public void sessionWorks() throws Exception {
 | 
				
			||||||
		ExchangeResult result = this.rest
 | 
							ExchangeResult result = this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -162,7 +176,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void principal() throws Exception {
 | 
						public void principal() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -173,7 +189,9 @@ public class HelloWebfluxFnApplicationITests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void headers() throws Exception {
 | 
						public void headers() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -76,7 +76,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWorks() throws Exception {
 | 
						public void basicWorks() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -87,7 +89,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicWhenPasswordInvalid401() throws Exception {
 | 
						public void basicWhenPasswordInvalid401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -98,7 +102,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin403() throws Exception {
 | 
						public void authorizationAdmin403() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -109,7 +115,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void authorizationAdmin200() throws Exception {
 | 
						public void authorizationAdmin200() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(adminCredentials())
 | 
								.filter(adminCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -119,7 +127,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicMissingUser401() throws Exception {
 | 
						public void basicMissingUser401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("missing-user", "password"))
 | 
								.filter(basicAuthentication("missing-user", "password"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -129,7 +139,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void basicInvalidPassword401() throws Exception {
 | 
						public void basicInvalidPassword401() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(invalidPassword())
 | 
								.filter(invalidPassword())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/admin")
 | 
								.uri("/admin")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -149,7 +161,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void sessionWorks() throws Exception {
 | 
						public void sessionWorks() throws Exception {
 | 
				
			||||||
		ExchangeResult result = this.rest
 | 
							ExchangeResult result = this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -171,7 +185,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
		WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator, springSecurityFilterChain).build();
 | 
							WebTestClient mockRest = WebTestClient.bindToRouterFunction(this.routerFunction).webFilter(exchangeMutator, springSecurityFilterChain).build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		mockRest
 | 
							mockRest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(exchangeMutator.perClient(withUser()))
 | 
								.filter(exchangeMutator.perClient(withUser()))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -187,7 +203,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void principal() throws Exception {
 | 
						public void principal() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -198,7 +216,9 @@ public class HelloWebfluxFnApplicationTests {
 | 
				
			||||||
	@Test
 | 
						@Test
 | 
				
			||||||
	public void headers() throws Exception {
 | 
						public void headers() throws Exception {
 | 
				
			||||||
		this.rest
 | 
							this.rest
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(robsCredentials())
 | 
								.filter(robsCredentials())
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/principal")
 | 
								.uri("/principal")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,7 +62,9 @@ public class WebClientOAuth2PocTests {
 | 
				
			||||||
		this.server.enqueue(new MockResponse().setResponseCode(200).setBody("OK"));
 | 
							this.server.enqueue(new MockResponse().setResponseCode(200).setBody("OK"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ClientResponse response = this.webClient
 | 
							ClientResponse response = this.webClient
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicIfNeeded("rob", "rob"))
 | 
								.filter(basicIfNeeded("rob", "rob"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/")
 | 
								.uri("/")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -80,7 +82,9 @@ public class WebClientOAuth2PocTests {
 | 
				
			||||||
		this.server.enqueue(new MockResponse().setResponseCode(200).setBody("OK"));
 | 
							this.server.enqueue(new MockResponse().setResponseCode(200).setBody("OK"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ClientResponse response = this.webClient
 | 
							ClientResponse response = this.webClient
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicIfNeeded("rob", "rob"))
 | 
								.filter(basicIfNeeded("rob", "rob"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/")
 | 
								.uri("/")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -99,7 +99,9 @@ public class AuthenticationWebFilterTests {
 | 
				
			||||||
			.build();
 | 
								.build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		EntityExchangeResult<String> result = client
 | 
							EntityExchangeResult<String> result = client
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("test","this"))
 | 
								.filter(basicAuthentication("test","this"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/")
 | 
								.uri("/")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					@ -120,7 +122,9 @@ public class AuthenticationWebFilterTests {
 | 
				
			||||||
			.build();
 | 
								.build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		EntityExchangeResult<Void> result = client
 | 
							EntityExchangeResult<Void> result = client
 | 
				
			||||||
 | 
								.mutate()
 | 
				
			||||||
			.filter(basicAuthentication("test", "this"))
 | 
								.filter(basicAuthentication("test", "this"))
 | 
				
			||||||
 | 
								.build()
 | 
				
			||||||
			.get()
 | 
								.get()
 | 
				
			||||||
			.uri("/")
 | 
								.uri("/")
 | 
				
			||||||
			.exchange()
 | 
								.exchange()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue