Add DelegatingServerLogoutHandler(List<ServerLogoutHandler> delegates)

Issue: gh-4839
This commit is contained in:
Rob Winch
2018-05-24 09:44:29 -05:00
parent 8c3fdb3bcf
commit 6a12415d23
2 changed files with 17 additions and 1 deletions

View File

@@ -30,6 +30,8 @@ import org.springframework.security.web.server.WebFilterExchange;
import reactor.test.publisher.PublisherProbe;
import java.util.List;
/**
* @author Eric Deandrea
* @since 5.1
@@ -57,13 +59,21 @@ public class DelegatingServerLogoutHandlerTests {
}
@Test
public void constructorWhenNullThenIllegalArgumentException() {
public void constructorWhenNullVargsThenIllegalArgumentException() {
assertThatThrownBy(() -> new DelegatingServerLogoutHandler((ServerLogoutHandler[]) null))
.isExactlyInstanceOf(IllegalArgumentException.class)
.hasMessage("delegates cannot be null or empty")
.hasNoCause();
}
@Test
public void constructorWhenNullListThenIllegalArgumentException() {
assertThatThrownBy(() -> new DelegatingServerLogoutHandler((List<ServerLogoutHandler>) null))
.isExactlyInstanceOf(IllegalArgumentException.class)
.hasMessage("delegates cannot be null or empty")
.hasNoCause();
}
@Test
public void constructorWhenEmptyThenIllegalArgumentException() {
assertThatThrownBy(() -> new DelegatingServerLogoutHandler(new ServerLogoutHandler[0]))