Provide TestRestTemplate for @WebIntegrationTests

Add a ContextCustomizerFactory to provide TestRestTemplate as a bean for
tests annotated with WebIntegrationTests. Additionally provide support
for automatically expanding URLs of the form `/example` to
`http://localhost:${local.server.port}/example`.

Fixes gh-5227
This commit is contained in:
Phillip Webb
2016-02-28 22:20:32 -08:00
parent cbea16ec01
commit ab7b48de84
6 changed files with 220 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
# Spring Test ContextCustomizerFactories
org.springframework.test.context.ContextCustomizerFactory=\
org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizerFactory,\
org.springframework.boot.test.context.web.WebIntegrationTestContextCustomizerFactory,\
org.springframework.boot.test.mock.mockito.MockitoContextCustomizerFactory
# Test Execution Listeners