io.mstream.trader.commons.test.guice.MockServerClientProvider Maven / Gradle / Ivy
The newest version!
package io.mstream.trader.commons.test.guice;
import io.mstream.trader.commons.test.MockServer;
import io.mstream.trader.commons.test.Socket;
import org.mockserver.client.server.MockServerClient;
import javax.inject.Inject;
import javax.inject.Provider;
public class MockServerClientProvider implements Provider {
private final Socket socket;
@Inject
public MockServerClientProvider(@MockServer Socket socket) {
this.socket = socket;
}
@Override
public MockServerClient get() {
return new MockServerClient(socket.getHost(), socket.getPort()).reset();
}
}