spring-projects / spring-projects/spring-boot
Provide MockWebServer Integration
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 81.5k
- Forks
- 42.7k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 65
Description
I'd like Spring Boot to provide integration with MockWebServer. For my particular case, I'd like to be able to leverage MockWebServer.url to configure environment variables for testing. For example, a user of Spring Boot's Security OAuth2 support might want to provide a value for spring.security.oauth2.resourceserver.jwt.issuer-uri that points to the MockWebServer.
One way a user might be able to integrate this is by providing a property that looks like:
spring.security.oauth2.resourceserver.jwt.issuer-uri=${mockwebserver.url}/oauth2/keys
Spring Boot could provide a hook that would change ${mockwebserver.url} into a URL created using MockWebServer.url.
A few points of consideration:
- The
MockWebServerwill need to be accessible to the user to add mock responses - We need to be able to reset the
MockWebServerbetween tests. - User's may want to customize the
MockWebServer
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the requested MockWebServer integration and the example spring.security.oauth2.resourceserver.jwt.issuer-uri property. Determine how users would access, reset, and customize MockWebServer instances and how the ${mockwebserver.url} placeholder should be resolved. Done means these integration points are defined and the OAuth2 testing example works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100