- Devian
- ChatGPT
- sap
- tomcat
- ionic
- Capire
- sapui5
- blue-green
- JavaScript
- HANA DB
- angularJS
- CAP Java
- Windows Service
- cf push
- 구글맵 예제
- eclipse plugin
- ionic3
- raspberry pi
- HANA Cloud
- cloud foundry
- BTP 배포
- Business Application Studio
- raspbian
- BTP
- TypeScript
- ionic native
- springboot
- SAP BTP
- BTP Deployment
- 윈도우 서비스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- Today
- Total
Ryan's Log
Java MokServer 본문
Java MokServer
간단히 MokServer를 구현해본다.
import org.mockserver.integration.ClientAndServer; import org.mockserver.model.HttpRequest; import org.mockserver.model.HttpResponse; public class MokServer { public static void main(String[] args) { ClientAndServer mockServer = ClientAndServer.startClientAndServer(50000); ForwardChainExpectation expectation = server.when(HttpRequest.request().withMethod("GET").withPath("/mok/hello")); expectation.respond(HttpResponse.response().withStatusCode(200).withBody("{output: \"Hello\"}")); System.out.println("Ready."); } }
MokServer.class를 구동 한 후 테스트
필요한 라이브러리
<!-- https://mvnrepository.com/artifact/org.mock-server/mockserver-netty --> <dependency> <groupId>org.mock-server</groupId> <artifactId>mockserver-netty</artifactId> <version>3.10.4</version> </dependency>
MokServer를 보다 잘 설명하신 정욱님의 블로그 연결
http://opennote46.tistory.com/208