Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
MockServer - the Ruby gem for the Mock Server API
MockServer enables easy mocking of any system you integrate with via HTTP or HTTPS with clients written in Java, JavaScript and Ruby and a simple REST API (as shown below).
MockServer Proxy is a proxy that introspects all proxied traffic including encrypted SSL traffic and supports Port Forwarding, Web Proxying (i.e. HTTP proxy), HTTPS Tunneling Proxying (using HTTP CONNECT) and SOCKS Proxying (i.e. dynamic port forwarding).
Both MockServer and the MockServer Proxy record all received requests so that it is possible to verify exactly what requests have been sent by the system under test.
This SDK is automatically generated by the OpenAPI Generator project:
To build the Ruby code into a gem:
gem build mockserver-client.gemspec
Then either install the gem locally:
gem install ./mockserver-client-5.3.0.gem
(for development, run gem install --dev ./mockserver-client-5.3.0.gem
to install the development dependencies)
or publish the gem to a gem hosting service, e.g. RubyGems.
Finally add this to the Gemfile:
gem 'mockserver-client', '~> 5.3.0'
If the Ruby gem is hosted at a git repository: https://github.com/GIT_USER_ID/GIT_REPO_ID, then add the following in the Gemfile:
gem 'mockserver-client', :git => 'https://github.com/GIT_USER_ID/GIT_REPO_ID.git'
Include the Ruby code directly using -I
as follows:
ruby -Ilib script.rb
Please follow the installation procedure and then run the following code:
# Load the gem
require 'mockserver-client'
api_instance = MockServer::ControlApi.new
ports = MockServer::Ports.new # Ports | list of ports to bind to, where 0 indicates dynamically bind to any available port
begin
#bind additional listening ports
result = api_instance.bind_put(ports)
p result
rescue MockServer::ApiError => e
puts "Exception when calling ControlApi->bind_put: #{e}"
end
All URIs are relative to http://localhost:1080
Class | Method | HTTP request | Description |
---|---|---|---|
MockServer::ControlApi | bind_put | PUT /bind | bind additional listening ports |
MockServer::ControlApi | clear_put | PUT /clear | clears expectations and recorded requests that match the request matcher |
MockServer::ControlApi | reset_put | PUT /reset | clears all expectations and recorded requests |
MockServer::ControlApi | retrieve_put | PUT /retrieve | retrieve recorded requests, active expectations, recorded expectations or log messages |
MockServer::ControlApi | status_put | PUT /status | return listening ports |
MockServer::ControlApi | stop_put | PUT /stop | stop running process |
MockServer::ExpectationApi | expectation_put | PUT /expectation | create expectation |
MockServer::VerifyApi | verify_put | PUT /verify | verify a request has been received a specific number of times |
MockServer::VerifyApi | verify_sequence_put | PUT /verifySequence | verify a sequence of request has been received in the specific order |
All endpoints do not require authorization.
FAQs
Unknown package
We found that mockserver-client-2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.