|
21 | 21 | import org.junit.jupiter.api.Test; |
22 | 22 | import org.junit.jupiter.api.extension.RegisterExtension; |
23 | 23 | import org.springframework.security.core.Authentication; |
24 | | -import org.springframework.security.core.GrantedAuthority; |
25 | 24 | import org.springframework.security.core.authority.SimpleGrantedAuthority; |
26 | 25 | import org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationToken; |
27 | 26 |
|
@@ -202,32 +201,6 @@ void allEnabledAndAlternatePrefix() { |
202 | 201 | .hasAttribute(ENDUSER_SCOPE, "scope1,scope2")); |
203 | 202 | } |
204 | 203 |
|
205 | | - @Test |
206 | | - void allEnabledAndNullAuthority() { |
207 | | - EnduserAttributesCapturer capturer = new EnduserAttributesCapturer(); |
208 | | - capturer.setEnduserIdEnabled(true); |
209 | | - capturer.setEnduserRoleEnabled(true); |
210 | | - capturer.setEnduserScopeEnabled(true); |
211 | | - |
212 | | - GrantedAuthority nullAuthority = () -> null; |
213 | | - Authentication authentication = |
214 | | - new PreAuthenticatedAuthenticationToken( |
215 | | - "principal", |
216 | | - null, |
217 | | - asList( |
218 | | - new SimpleGrantedAuthority("ROLE_role1"), |
219 | | - nullAuthority, |
220 | | - new SimpleGrantedAuthority("SCOPE_scope1"))); |
221 | | - |
222 | | - test( |
223 | | - capturer, |
224 | | - authentication, |
225 | | - span -> |
226 | | - span.hasAttribute(ENDUSER_ID, "principal") |
227 | | - .hasAttribute(ENDUSER_ROLE, "role1") |
228 | | - .hasAttribute(ENDUSER_SCOPE, "scope1")); |
229 | | - } |
230 | | - |
231 | 204 | private static void test( |
232 | 205 | EnduserAttributesCapturer capturer, |
233 | 206 | Authentication authentication, |
|
0 commit comments