Polish SecurityProperties

See gh-33251
pull/33270/head
Vedran Pavic 2 years ago committed by Andy Wilkinson
parent 3c1c91bc5d
commit c1691f525a

@ -17,8 +17,7 @@
package org.springframework.boot.autoconfigure.security;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;
@ -83,8 +82,7 @@ public class SecurityProperties {
/**
* Security filter chain dispatcher types.
*/
private Set<DispatcherType> dispatcherTypes = new HashSet<>(Arrays.asList(DispatcherType.ASYNC,
DispatcherType.ERROR, DispatcherType.REQUEST, DispatcherType.FORWARD, DispatcherType.INCLUDE));
private Set<DispatcherType> dispatcherTypes = EnumSet.allOf(DispatcherType.class);
public int getOrder() {
return this.order;

@ -17,6 +17,7 @@
package org.springframework.boot.autoconfigure.security.servlet;
import java.security.interfaces.RSAPublicKey;
import java.util.EnumSet;
import jakarta.servlet.DispatcherType;
import org.assertj.core.api.InstanceOfAssertFactories;
@ -161,8 +162,7 @@ class SecurityAutoConfigurationTests {
DelegatingFilterProxyRegistrationBean.class);
assertThat(bean)
.extracting("dispatcherTypes", InstanceOfAssertFactories.iterable(DispatcherType.class))
.containsOnly(DispatcherType.ASYNC, DispatcherType.ERROR, DispatcherType.REQUEST,
DispatcherType.INCLUDE, DispatcherType.FORWARD);
.containsOnly(EnumSet.allOf(DispatcherType.class).toArray(new DispatcherType[0]));
});
}

Loading…
Cancel
Save