Skip to content
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

Javadoc of slice test annotations should describe more accurately which components are considered #41914

Closed
Narkissus opened this issue Aug 18, 2024 · 2 comments
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@Narkissus
Copy link

Spring Boot version: 3.3.2

According to the javadoc on org.springframework.boot.test.autoconfigure.webservices.server.WebServiceServerTest annotation, it should configure the context in a way that webservice relevant beans are present - i.e. beans of type Endpoint and EndpointInterceptor.
During my testing I have noticed that the EndpointInterceptor types are absent from the application context during tests while using @WebServiceServerTest.
The current workaround is to import the configuration class where the EndpointInterceptor beans are defined.

You can find a minimal reproducible example code at https://github.com/Narkissus/WebServiceServerTest-issue-example

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 18, 2024
@wilkinsona wilkinsona changed the title Annotation WebServiceServerTest does not include EndpointInterceptor beans into context @WebServiceServerTest does not include EndpointInterceptor beans Aug 19, 2024
@snicoll snicoll self-assigned this Aug 19, 2024
@snicoll
Copy link
Member

snicoll commented Aug 19, 2024

@Narkissus thanks for the sample.

it should configure the context in a way that webservice relevant beans are present - i.e. beans of type Endpoint and EndpointInterceptor.

I think that the word "scan" is missing in the Javadoc of this slice test for some reason. The intent is that component scanning will only pick up beans annotated with @Endpoint or of type EndpointInterceptor. Your interceptors are configured in a configuration class, slice tests won't selectively pick up @Bean methods as you seem to expect.

We'll get the Javadoc fixed. I've submitted a PR to your sample that fixes the test and provide more context.

@snicoll snicoll changed the title @WebServiceServerTest does not include EndpointInterceptor beans Javadoc of @WebServiceServerTest should mention that EndpointInterceptor scanned components are included Aug 19, 2024
@snicoll snicoll added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 19, 2024
@snicoll snicoll added this to the 3.2.x milestone Aug 19, 2024
KonarzewskiP added a commit to KonarzewskiP/spring-boot that referenced this issue Aug 19, 2024
@snicoll snicoll changed the title Javadoc of @WebServiceServerTest should mention that EndpointInterceptor scanned components are included Javadoc of slice test annotations should describe more accurately which components are considered Aug 19, 2024
@snicoll
Copy link
Member

snicoll commented Aug 19, 2024

I've extended the scope of this issue as other slice tests suffer from the same problem.

snicoll added a commit to snicoll/spring-boot that referenced this issue Aug 19, 2024
This commit harmonizes the phrasing that we use to describe what
components are considered for scanning when a slice test is enabled.

This makes the description of the default filter explicit, with an
exhaustive description of the annotations and/or base classes.

Closes spring-projectsgh-41914
@snicoll snicoll modified the milestones: 3.2.x, 3.2.9 Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants