16
16
17
17
package org .springframework .session .aot .hint ;
18
18
19
- import java .util .ArrayList ;
20
- import java .util .TreeSet ;
21
19
import java .util .stream .Stream ;
22
20
23
21
import org .junit .jupiter .api .Test ;
29
27
import org .springframework .aot .hint .TypeReference ;
30
28
import org .springframework .aot .hint .predicate .RuntimeHintsPredicates ;
31
29
import org .springframework .core .io .support .SpringFactoriesLoader ;
32
- import org .springframework .security .authentication .AbstractAuthenticationToken ;
33
- import org .springframework .security .authentication .AccountExpiredException ;
34
- import org .springframework .security .authentication .AuthenticationServiceException ;
35
- import org .springframework .security .authentication .BadCredentialsException ;
36
- import org .springframework .security .authentication .CredentialsExpiredException ;
37
- import org .springframework .security .authentication .DisabledException ;
38
- import org .springframework .security .authentication .InsufficientAuthenticationException ;
39
- import org .springframework .security .authentication .LockedException ;
40
- import org .springframework .security .authentication .ProviderNotFoundException ;
41
- import org .springframework .security .authentication .UsernamePasswordAuthenticationToken ;
42
- import org .springframework .security .core .AuthenticationException ;
43
- import org .springframework .security .core .authority .SimpleGrantedAuthority ;
44
- import org .springframework .security .core .context .SecurityContextImpl ;
45
- import org .springframework .security .core .userdetails .User ;
46
- import org .springframework .security .core .userdetails .UsernameNotFoundException ;
47
30
48
31
import static org .assertj .core .api .Assertions .assertThat ;
49
32
@@ -60,7 +43,7 @@ class CommonSessionSecurityRuntimeHintsTests {
60
43
61
44
@ ParameterizedTest
62
45
@ MethodSource ("getSerializationHintTypes" )
63
- void coreTypesHasHints (TypeReference typeReference ) {
46
+ void commonSecurityTypesHasHints (TypeReference typeReference ) {
64
47
this .commonSessionSecurityRuntimeHints .registerHints (this .hints , getClass ().getClassLoader ());
65
48
assertThat (RuntimeHintsPredicates .serialization ().onType (typeReference )).accepts (this .hints );
66
49
}
@@ -74,29 +57,25 @@ void aotFactoriesContainsRegistrar() {
74
57
}
75
58
76
59
private static Stream <TypeReference > getSerializationHintTypes () {
77
- return Stream .of (TypeReference .of (String .class ), TypeReference .of (ArrayList .class ),
78
- TypeReference .of (TreeSet .class ), TypeReference .of (SecurityContextImpl .class ),
79
- TypeReference .of (SimpleGrantedAuthority .class ), TypeReference .of (User .class ),
80
- TypeReference .of (Number .class ), TypeReference .of (Long .class ), TypeReference .of (Integer .class ),
81
- TypeReference .of (AbstractAuthenticationToken .class ),
82
- TypeReference .of (UsernamePasswordAuthenticationToken .class ), TypeReference .of (StackTraceElement .class ),
83
- TypeReference .of (Throwable .class ), TypeReference .of (Exception .class ),
84
- TypeReference .of (RuntimeException .class ), TypeReference .of (AuthenticationException .class ),
85
- TypeReference .of (BadCredentialsException .class ), TypeReference .of (UsernameNotFoundException .class ),
86
- TypeReference .of (AccountExpiredException .class ), TypeReference .of (ProviderNotFoundException .class ),
87
- TypeReference .of (DisabledException .class ), TypeReference .of (LockedException .class ),
88
- TypeReference .of (AuthenticationServiceException .class ),
89
- TypeReference .of (CredentialsExpiredException .class ),
90
- TypeReference .of (InsufficientAuthenticationException .class ),
60
+ return Stream .of (TypeReference .of ("org.springframework.security.core.context.SecurityContextImpl" ),
61
+ TypeReference .of ("org.springframework.security.core.authority.SimpleGrantedAuthority" ),
62
+ TypeReference .of ("org.springframework.security.core.userdetails.User" ),
63
+ TypeReference .of ("org.springframework.security.authentication.AbstractAuthenticationToken" ),
64
+ TypeReference .of ("org.springframework.security.authentication.UsernamePasswordAuthenticationToken" ),
65
+ TypeReference .of ("org.springframework.security.core.AuthenticationException" ),
66
+ TypeReference .of ("org.springframework.security.authentication.BadCredentialsException" ),
67
+ TypeReference .of ("org.springframework.security.core.userdetails.UsernameNotFoundException" ),
68
+ TypeReference .of ("org.springframework.security.authentication.AccountExpiredException" ),
69
+ TypeReference .of ("org.springframework.security.authentication.ProviderNotFoundException" ),
70
+ TypeReference .of ("org.springframework.security.authentication.DisabledException" ),
71
+ TypeReference .of ("org.springframework.security.authentication.LockedException" ),
72
+ TypeReference .of ("org.springframework.security.authentication.AuthenticationServiceException" ),
73
+ TypeReference .of ("org.springframework.security.authentication.CredentialsExpiredException" ),
74
+ TypeReference .of ("org.springframework.security.authentication.InsufficientAuthenticationException" ),
91
75
TypeReference
92
76
.of ("org.springframework.security.web.authentication.session.SessionAuthenticationException" ),
93
77
TypeReference .of (
94
78
"org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationException" ),
95
- TypeReference .of ("java.util.Collections$UnmodifiableCollection" ),
96
- TypeReference .of ("java.util.Collections$UnmodifiableList" ),
97
- TypeReference .of ("java.util.Collections$EmptyList" ),
98
- TypeReference .of ("java.util.Collections$UnmodifiableRandomAccessList" ),
99
- TypeReference .of ("java.util.Collections$UnmodifiableSet" ),
100
79
TypeReference .of ("org.springframework.security.core.userdetails.User$AuthorityComparator" ),
101
80
TypeReference .of ("org.springframework.security.oauth2.server.resource.BearerTokenAuthenticationToken" ),
102
81
TypeReference .of (
0 commit comments