wiremock

Can WireMock play back requests from multiple domains?

笑着哭i 提交于 2019-12-02 00:24:21
问题 I am building a Dockerised record-playback system to help me record websites, so I can design scrapers aginst a local version rather than the real thing. This means that I do not swamp a website with automated requests, and has the added advantage that I do not need to be connected to the web to work. I have used the Java-based WireMock internally, which records from a queue of site scrapes using Wget. I am using the WireMock API to read various pieces information from the mappings it records

Can WireMock play back requests from multiple domains?

随声附和 提交于 2019-12-01 20:37:43
I am building a Dockerised record-playback system to help me record websites, so I can design scrapers aginst a local version rather than the real thing. This means that I do not swamp a website with automated requests, and has the added advantage that I do not need to be connected to the web to work. I have used the Java-based WireMock internally, which records from a queue of site scrapes using Wget. I am using the WireMock API to read various pieces information from the mappings it records. However, I have spotted from a mapping response that domain information does not seem to be recorded

Java单元测试 Http Server Mock框架选型

匆匆过客 提交于 2019-12-01 10:07:40
背景动机 某期优化需要针对通用的HttpClient封装组件--HttpExecutor在保证上层暴露API不动的前提做较多改动,大致包括以下几点: apache http client 版本升级 HttpClientBuilder代码重构 RequestBuilder代码重构 自定义RetryHandler HttpContext扩展 自定义HttpRequestInterceptor/HttpResponseInterceptor 代码很快修改完了,但是如何保证HttpExecutor的行为和以前是一致的呢?很容易就想到是单元测试。因为以前的代码并未提供组件的单元测试,都是依赖QA同学的黑盒测试完成,现有的单元测试又都是在更上层的HttpDao上,重点是对返回数据的解析逻辑代码验证,直接Mock了HttpExecutor的返回结果,完全无法覆盖底层组件的请求逻辑,因此配合本期优化需要提供HttpExecutor组件的单元测试。 需求分析 先大致分析一下HttpExecutor组件提供的功能: 注册apache http client实例的初始化和销毁,包含ConnectionManager等apache http client子功能组件; 上层入参的转封装,以及HttpResponse结果的初步解析封装(response header、status code、response

Using WireMock with SOAP Web Services in Java

人盡茶涼 提交于 2019-11-28 20:49:26
I am totally new to WireMock . Until now, I have been using mock responses using SOAPUI. My use case is simple: Just firing SOAP XML requests to different endpoints ( http://localhost:9001/endpoint1 ) and getting canned XML response back. But MockWrire has to be deployed as a standalone service onto a dedicated server which will act a central location from where mock responses will be served. Just wanted some starting suggestions. As I can see WireMock is more suitable towards REST web services. So my doubts are: 1) Do I need to deploy it to a java web server or container to act as always