spring-projects / spring-boot

Spring Boot helps you to create Spring-powered, production-grade applications and services with absolute minimum fuss.
https://spring.io/projects/spring-boot
Apache License 2.0
75.4k stars 40.74k forks source link

Provide MockWebServer Integration #14223

Open rwinch opened 6 years ago

rwinch commented 6 years ago

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:

philwebb commented 6 years ago

@rwinch Do you mean this MockWebServer?

rwinch commented 6 years ago

@philwebb Thanks for the fast response. Yes that is what I mean.

philwebb commented 6 years ago

See also #5173 which relates to using wiremock.