Merge pull request #33251 from vpavic

* gh-33251:
  Polish "Polish SecurityProperties"
  Polish SecurityProperties

Closes gh-33251
pull/33270/head
Andy Wilkinson 2 years ago
commit 22b054dc1d

@ -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);
.containsExactlyInAnyOrderElementsOf(EnumSet.allOf(DispatcherType.class));
});
}

Loading…
Cancel
Save