Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mockserver-client-2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mockserver-client-2

  • 5.3.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

mockserver-client

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:

  • API version: 5.3.0
  • Package version: 5.3.0
  • Build package: org.openapitools.codegen.languages.RubyClientCodegen

Installation

Build a gem

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'

Install from Git

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

Include the Ruby code directly using -I as follows:

ruby -Ilib script.rb

Getting Started

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

Documentation for API Endpoints

All URIs are relative to http://localhost:1080

ClassMethodHTTP requestDescription
MockServer::ControlApibind_putPUT /bindbind additional listening ports
MockServer::ControlApiclear_putPUT /clearclears expectations and recorded requests that match the request matcher
MockServer::ControlApireset_putPUT /resetclears all expectations and recorded requests
MockServer::ControlApiretrieve_putPUT /retrieveretrieve recorded requests, active expectations, recorded expectations or log messages
MockServer::ControlApistatus_putPUT /statusreturn listening ports
MockServer::ControlApistop_putPUT /stopstop running process
MockServer::ExpectationApiexpectation_putPUT /expectationcreate expectation
MockServer::VerifyApiverify_putPUT /verifyverify a request has been received a specific number of times
MockServer::VerifyApiverify_sequence_putPUT /verifySequenceverify a sequence of request has been received in the specific order

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

FAQs

Package last updated on 03 Mar 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc