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

Add @WebEndpointTest for testing custom actuator web points #11399

Closed
manderson23 opened this issue Dec 22, 2017 · 4 comments
Closed

Add @WebEndpointTest for testing custom actuator web points #11399

manderson23 opened this issue Dec 22, 2017 · 4 comments
Labels
status: declined A suggestion or change that we don't feel we should currently apply

Comments

@manderson23
Copy link

It would be convenient if, similar to @WebMvcTest, there was a @WebEndpointTest annotation to support testing custom @WebEndpoint implementations.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Dec 22, 2017
@snicoll
Copy link
Member

snicoll commented Dec 27, 2017

@manderson23 can you expand on what you are expecting exactly? Is that an web-specific test style where you could use MockMvc to contact the endpoint? You can't use MockMvc with a reactive-based app so that's not really realistic.

We use a custom rule to make sure each endpoint runs consistently with MVC, WebFlux and Jersery. I am not sure that's what you're after.

@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label Dec 27, 2017
@manderson23
Copy link
Author

@snicoll OK in my case I'm MVC only so I'd be happy to make my own rule. I did look at your tests and seen the custom rule there. Would it be feasible and/or useful to make that part of the public API?

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 28, 2017
@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Dec 29, 2017
@wilkinsona
Copy link
Member

I'm reluctant to make WebEndpointRunners public as I don't want to be affected by the constraints that it would introduce. Being able to make breaking changes to the runner whenever we like is rather useful. Unfortunately, I don't think we have time in 2.0 to revisit our runner to get it into a state where it's ready to be public.

@wilkinsona
Copy link
Member

We discussed this a bit more today, and our feeling is that you should either just unit test your endpoint and trust the infrastructure to do what it claims to do, or you can create a full-blown integration test and call the endpoint using TestRestTemplate, for example.

@wilkinsona wilkinsona added status: declined A suggestion or change that we don't feel we should currently apply and removed for: team-attention An issue we'd like other members of the team to review status: feedback-provided Feedback has been provided status: waiting-for-triage An issue we've not yet triaged labels Jan 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined A suggestion or change that we don't feel we should currently apply
Projects
None yet
Development

No branches or pull requests

4 participants