Skip to content

WithSecurityContextTestExecutionListener should respect NestedTestConfiguration #9193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rwinch opened this issue Nov 6, 2020 · 0 comments
Closed
Assignees
Labels
in: test An issue in spring-security-test type: bug A general bug
Milestone

Comments

@rwinch
Copy link
Member

rwinch commented Nov 6, 2020

Describe the bug

In the following code testNoAnnotation should not use @WithMockUser because the mode is EnclosingConfiguration.OVERRIDE.

	@WithMockUser
	@NestedTestConfiguration(NestedTestConfiguration.EnclosingConfiguration.OVERRIDE)
	class OverrideOuterClass {

		class InnerClass {

			void testNoAnnotation() {
			}

		}

	}

To solve this WithSecurityContextTestExecutionListener should leverage TestContextAnnotationUtils.

@rwinch rwinch added in: test An issue in spring-security-test type: bug A general bug labels Nov 6, 2020
@rwinch rwinch added this to the 5.5.0-M2 milestone Nov 6, 2020
@rwinch rwinch self-assigned this Nov 6, 2020
@rwinch rwinch closed this as completed in 4515c86 Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: test An issue in spring-security-test type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant