Skip to content

Clarify documentation code snippet(s) (unclear where static imported methods come from) #6597

Closed
@kdvolder

Description

@kdvolder

Working with the documentation and trying to get something compiling can be pretty painful when code samples in docs do not include imports. This especially so when statically imported methods are being imported.

This is the section in the docs I'm particularly fighting with at the moment:

https://docs.spring.io/spring-security/site/docs/current/reference/html/test-webflux.html

    @Before
    public void setup() {
        this.rest = WebTestClient
            .bindToApplicationContext(this.context)
            // add Spring Security test Support
            .apply(springSecurity())
            .configureClient()
            .filter(basicAuthentication())
            .build();
    }

Where are the methods 'springSecurity()' and 'basicAuthentication()' defined?

I appreciate the desire to keep the snippets focussed and leave out 'unnecessary cruft'. But I think imports are rather crucial when you want to copy paste sample code from the docs and get it to compile properly.

Metadata

Metadata

Labels

in: docsAn issue in Documentation or samplestype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions