- tomcat
- 구글맵 예제
- HANA Cloud
- ionic3
- CAP Java
- Devian
- ionic native
- BTP 배포
- 윈도우 서비스
- eclipse plugin
- SAP BTP
- sapui5
- springboot
- angularJS
- Capire
- Windows Service
- cloud foundry
- ionic
- ChatGPT
- raspberry pi
- blue-green
- TypeScript
- raspbian
- JavaScript
- HANA DB
- cf push
- BTP Deployment
- BTP
- sap
- Business Application Studio
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 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