java -Dmockserver.logLevel=INFO -jar mockserver-netty-5.3.0-jar-with-dependencies.jar -serverPort 1080
org.mockserver.client.server.MockServerClient
: 원격 MockServer 인스턴스에 접속하여 expectation을 선언하는 Client Classorg.mockserver.integration.ClientAndServer
: 로컬 MockServer 인스턴스를 생성하고 여기에 expectation을 선언하고 요청을 날린다.import static org.mockserver.model.HttpRequest.request; org.mockserver.model.HttpResponse#response() new MockServerClient("localhost", 1080) .when( request() .withMethod("GET") .withPath("/hello") ) .respond( response() .withDelay(TimeUnit.SECONDS, 3) .withBody("World!!" + LocalDateTime.now()) );