@ Bean public BatchStubRunner batchStubRunner ( ) { StubRunnerOptionsBuilder builder = builder ( ) ; if ( this . props . getProxyHost ( ) != null ) { builder . withProxy ( this . props . getProxyHost ( ) , this . props . getProxyPort ( ) ) ; } StubRunnerOptions stubRunnerOptions = builder . build ( ) ; BatchStubRunner batchStubRunner = new BatchStubRunnerFactory ( stubRunnerOptions , this . provider . get ( stubRunnerOptions ) , this . contractVerifierMessaging != null ? this . contractVerifierMessaging : new NoOpStubMessages ( ) ) . buildBatchStubRunner ( ) ; // TODO: Consider running it in a separate thread RunningStubs runningStubs = batchStubRunner . runStubs ( ) ; registerPort ( runningStubs ) ; return batchStubRunner ; }
Bean that initializes stub runners runs them and on shutdown closes them . Upon its instantiation JAR with stubs is downloaded and unpacked to a temporary folder and WireMock server are started for each of those stubs