|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
- * Copyright 2002-2023 the original author or authors.
|
|
|
|
|
|
+ * Copyright 2002-2024 the original author or authors.
|
|
*
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* you may not use this file except in compliance with the License.
|
|
@@ -111,7 +111,7 @@ class ConcurrentSessionControlServerAuthenticationSuccessHandlerTests {
|
|
Authentication authentication = TestAuthentication.authenticatedUser();
|
|
Authentication authentication = TestAuthentication.authenticatedUser();
|
|
List<ReactiveSessionInformation> sessions = Arrays.asList(createSessionInformation("100"),
|
|
List<ReactiveSessionInformation> sessions = Arrays.asList(createSessionInformation("100"),
|
|
createSessionInformation("101"));
|
|
createSessionInformation("101"));
|
|
- given(this.sessionRegistry.getAllSessions(authentication.getPrincipal(), false))
|
|
|
|
|
|
+ given(this.sessionRegistry.getAllSessions(authentication.getPrincipal()))
|
|
.willReturn(Flux.fromIterable(sessions));
|
|
.willReturn(Flux.fromIterable(sessions));
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), authentication).block();
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), authentication).block();
|
|
verify(this.handler).handle(this.contextCaptor.capture());
|
|
verify(this.handler).handle(this.contextCaptor.capture());
|
|
@@ -127,7 +127,7 @@ class ConcurrentSessionControlServerAuthenticationSuccessHandlerTests {
|
|
List<ReactiveSessionInformation> sessions = Arrays.asList(createSessionInformation("100"),
|
|
List<ReactiveSessionInformation> sessions = Arrays.asList(createSessionInformation("100"),
|
|
createSessionInformation("101"), createSessionInformation("102"), createSessionInformation("103"),
|
|
createSessionInformation("101"), createSessionInformation("102"), createSessionInformation("103"),
|
|
createSessionInformation("104"));
|
|
createSessionInformation("104"));
|
|
- given(this.sessionRegistry.getAllSessions(authentication.getPrincipal(), false))
|
|
|
|
|
|
+ given(this.sessionRegistry.getAllSessions(authentication.getPrincipal()))
|
|
.willReturn(Flux.fromIterable(sessions));
|
|
.willReturn(Flux.fromIterable(sessions));
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), authentication).block();
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), authentication).block();
|
|
verify(this.handler).handle(this.contextCaptor.capture());
|
|
verify(this.handler).handle(this.contextCaptor.capture());
|
|
@@ -151,10 +151,8 @@ class ConcurrentSessionControlServerAuthenticationSuccessHandlerTests {
|
|
List<ReactiveSessionInformation> adminSessions = Arrays.asList(createSessionInformation("200"),
|
|
List<ReactiveSessionInformation> adminSessions = Arrays.asList(createSessionInformation("200"),
|
|
createSessionInformation("201"));
|
|
createSessionInformation("201"));
|
|
|
|
|
|
- given(this.sessionRegistry.getAllSessions(user.getPrincipal(), false))
|
|
|
|
- .willReturn(Flux.fromIterable(userSessions));
|
|
|
|
- given(this.sessionRegistry.getAllSessions(admin.getPrincipal(), false))
|
|
|
|
- .willReturn(Flux.fromIterable(adminSessions));
|
|
|
|
|
|
+ given(this.sessionRegistry.getAllSessions(user.getPrincipal())).willReturn(Flux.fromIterable(userSessions));
|
|
|
|
+ given(this.sessionRegistry.getAllSessions(admin.getPrincipal())).willReturn(Flux.fromIterable(adminSessions));
|
|
|
|
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), user).block();
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), user).block();
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), admin).block();
|
|
this.strategy.onAuthenticationSuccess(new WebFilterExchange(this.exchange, this.chain), admin).block();
|