Fix bug with stale state in http request factory

If we don't re-use an existing factory, the label doesn't change and
all the snippets get generated with the same identifier.

Remove explicit version from wiremock test

Add snippets attribute to build config

See gh-295
This commit is contained in:
Dave Syer 2017-02-01 17:52:07 +00:00 committed by Stephane Nicoll
parent c7953bf999
commit 6242df5b6e
3 changed files with 4 additions and 2 deletions

View File

@ -74,6 +74,7 @@
<attributes>
<docinfo>true</docinfo>
<spring-boot-version>${spring.boot.version}</spring-boot-version>
<snippets>${basedir}/../initializr-web/target/snippets</snippets>
</attributes>
</configuration>
</execution>

View File

@ -26,8 +26,7 @@ import static org.springframework.boot.test.context.SpringBootTest.*;
@SpringBootTest(webEnvironment = WebEnvironment.NONE)
// Need a spring boot app. Doesn't really have one
@AutoConfigureStubRunner(
// TODO: can't hardcode the version there as it must be automatically replaced when releasing
ids = "io.spring.initializr:initializr-web:0.3.0.BUILD-SNAPSHOT",
ids = "io.spring.initializr:initializr-web",
workOffline = true)
public class InitializrIntegrationTests {

View File

@ -39,6 +39,8 @@ public final class MockMvcClientHttpRequestFactoryTestExecutionListener
beanFactory.getBean(MockMvc.class));
beanFactory.registerSingleton("mockMvcClientHttpRequestFactory",
this.factory);
} else {
factory = beanFactory.getBean("mockMvcClientHttpRequestFactory", MockMvcClientHttpRequestFactory.class);
}
}