본문 바로가기
IBM - old/IBM APIC

[APIC]Mock Backend Services with User Defined Gateway Policies

by freeman98 2017. 5. 19.

안녕하세요 이정운입니다.


IBM API Connect 와 같은 API Management 솔루션에 대한 프로젝트 시에 항상 이슈가 되는 것은 테스트입니다.


왜냐면 결국 호출이 되는 Backend API 가 있어야 IBM API Connect 에서 설정하거나 client 를 이용한 테스트가 가능하기 때문입니다.


이 부분을 조금 편하게 수행하기 위하여 IBM 에서 IBM API Connect 를 위한 Mock Backend Services 를 공개했네요.


테스트시에 도움이 많이 될것 같으니 참고하시기 바라겠습니다.



https://developer.ibm.com/apiconnect/2017/05/11/mocking-backend-services-gateway-policies/


Mock Backend Services with User Defined Gateway Policies

Testing your API implementation is critical, but not always easy. Sometimes your backend services aren’t set up to handle the load of testing. Even worse, sometimes backend services go down altogether. API Mocka provides a simple way to stub backend systems, so you can test and optimize your API implementation without relying on direct access to services.


How API Mocka Works

API Mocka is a set of custom policies for mocking back end services (download from GitHub here.) The API Mocka Policies provide you the ability to stub as a service. Coupled with the out of the box set-variable policy, a complete service implementation can be provided very simply.


There are two policies provided: JSON Mocka and XML Mocka. The only difference been them is the datatype they support. Each policy takes a single parameter that contains the desired mock response. This response can take variables such as context variables or API parameters in the usual manner with $(varname) or {varname}.



 

The policies can be downloaded from GitHub here: https://github.com/ChrisPhillips-cminion/APIConnect-Policy-Mocka/releases

Happy testing!


Special thanks to Stephen Linn for his help with the coding of API Mocka


댓글