All Projects β†’ cjstehno β†’ ersatz

cjstehno / ersatz

Licence: Apache-2.0 license
πŸ€– A simulated HTTP server for testing client code with configurable responses.

Programming Languages

java
68154 projects - #9 most used programming language
groovy
2714 projects
CSS
56736 projects
HTML
75241 projects

Labels

Projects that are alternatives of or similar to ersatz

Http Fake Backend
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Stars: ✭ 253 (+475%)
Mutual labels:  mock
aem-stubs
Tool for providing sample data for AEM applications in a simple and flexible way. Stubbing server on AEM, no separate needed.
Stars: ✭ 40 (-9.09%)
Mutual labels:  mock
redismock
Redis client Mock
Stars: ✭ 164 (+272.73%)
Mutual labels:  mock
go-github-mock
A library to aid unittesting code that uses Golang's Github SDK
Stars: ✭ 63 (+43.18%)
Mutual labels:  mock
HttpClientMock
Library for mocking Apache HttpClient.
Stars: ✭ 41 (-6.82%)
Mutual labels:  mock
graphql-mock-api
A GraphQL mock to any GraphQL schema
Stars: ✭ 28 (-36.36%)
Mutual labels:  mock
Gripmock
gRPC Mock Server
Stars: ✭ 248 (+463.64%)
Mutual labels:  mock
springmock
alternative spring mocking infrastructure
Stars: ✭ 22 (-50%)
Mutual labels:  mock
mocka
Mocka - The complete testing framework for LUA and Nginx
Stars: ✭ 26 (-40.91%)
Mutual labels:  mock
tplink-smarthome-simulator
TP-Link Smarthome Device Simulator
Stars: ✭ 55 (+25%)
Mutual labels:  mock
openman
Postman to OpenAPI Spec converter with mocking and documentation
Stars: ✭ 17 (-61.36%)
Mutual labels:  mock
xrm-mock-generator
πŸ“– Β Generates a mock Xrm.Page object. Commonly used by xrm-mock to test Dynamics 365 client-side customisations.
Stars: ✭ 15 (-65.91%)
Mutual labels:  mock
fe-dev-server
FE Dev Server target to help frontend web developers create view template, styles and js easily.
Stars: ✭ 30 (-31.82%)
Mutual labels:  mock
Vue Element Admin
πŸŽ‰ A magical vue admin https://panjiachen.github.io/vue-element-admin
Stars: ✭ 73,044 (+165909.09%)
Mutual labels:  mock
platypus
Very simple and customizable mock/echo server
Stars: ✭ 15 (-65.91%)
Mutual labels:  mock
Mujina
A mock IDP and SP using the OpenSAML library
Stars: ✭ 250 (+468.18%)
Mutual labels:  mock
walletconnect-test-wallet
Test Wallet (Web)
Stars: ✭ 163 (+270.45%)
Mutual labels:  mock
json-fake-server
Simple way to create http server (node js) https://www.npmjs.com/package/test-fake-server
Stars: ✭ 15 (-65.91%)
Mutual labels:  mock
observer-spy
This library makes RxJS Observables testing easy!
Stars: ✭ 310 (+604.55%)
Mutual labels:  mock
puppet-mock
Puppet Mocker for Wechaty (& A Puppet Template Starter)
Stars: ✭ 33 (-25%)
Mutual labels:  mock

Ersatz Server

If you use this project and would like to help keep it running, please consider making a donation.

β˜• Buy me a coffee?

Quick Links

Introduction

The Ersatz Server is a HTTP client testing tool which allows for request/response expectations to be configured in a flexible manner. The expectations will respond in a configured manner to requests and allow testing with different responses and/or error conditions without having to write a lot of boiler-plate code.

Warning: v3.x is NOT directly backwards compatible with the 2.x releases. Some lesser-used features have been removed and the Groovy DSL has been extracted into its own extension library - see the What's New in 3.0 section of the User Guide for details and a migration guide.

Warning: v2.x has removed some unused features of the library and extracted the Groovy support into it's own extension library. See the What's New in 2.0 section of the User Guide for details and a migration guide.

Getting Started

Project artifacts are available via the Maven Central repository. Below are the dependency coordinates for Gradle and Maven, more details are provided in the Getting Started section of the User Guide.

Gradle

testImplementation 'io.github.cjstehno.ersatz:ersatz:3.2.0'

// or, for the Groovy DSL extensions
testImplementation 'io.github.cjstehno.ersatz:ersatz-groovy:3.2.0'

Maven

<dependency>
    <groupId>io.github.cjstehno.ersatz</groupId>
    <artifactId>ersatz</artifactId>
    <version>3.2.0</version>
    <scope>test</scope>
</dependency>

<!-- or, for the Groovy DSL extensions -->
<dependency>
    <groupId>io.github.cjstehno.ersatz</groupId>
    <artifactId>ersatz-groovy</artifactId>
    <version>3.2.0</version>
    <scope>test</scope>
</dependency>

Shadowed

There is a safe (shadowed) version of each library available, which is useful in cases where you already have a version of Undertow in use (to avoid version collisions). See the Shadow Jar section of the User Guide for more information.

Build Instructions

Ersatz is built using Gradle:

./gradlew clean build

Or, if the "shadow" artifact is desired:

./gradlew clean build shadowJar

If you are interested in building the website, with all documentation and reports, you can run the following:

./gradlew site

In order to build specific reports, run the appropriate one of the following:

./gradlew asciidoctor
./gradlew javadoc
./gradlew jacocoTestReport
./gradlew test

Publishing

To Local Maven Repo

You can publish the all the source, javadoc, "safe" and regular jars to your local maven repository (~/.m2/repository directory) using the following command:

./gradlew publishToMavenLocal -x sign

// or, if you have not built recently
./gradlew clean build publishToMavenLocal -x sign

The -x sign skips the signing step, which requires signing information. See the section on "signing" below if you need to have the locally published artifacts signed.

To Maven Central

Before you publish a release, be sure to generate a release build (see signing section for details):

./gradlew clean build shadowJar signErsatzGroovyPublication signErsatzPublication -Psigning.gnupg.keyName=<key-id> -Psigning.gnupg.passphrase=<key-pass>

Then, to publish the artifacts to the Maven Central Repository, run

./gradlew publish -PossrhUser=<jira-user> -PossrhPass=<jira-pass> -Psigning.gnupg.keyName=<key-id> -Psigning.gnupg.passphrase=<key-pass>

The additional "signing." properties are required to sign the artifacts, see the Signing section below for more details.

Once the artifacts have been published, sign-in to https://s01.oss.sonatype.org and navigate to the "Staging Repositories" and "Close" the published artifacts - this may take some time to appear. If there are errors, you can "Drop" it, fix them and publish again.

After you have successfully "closed" the staging repository, you can release it by pressing the "Release" button.

Signing

When publishing the artifacts to the Maven Central Repository, they need to be signed. In order to keep the signing information secret, the properties are added only when the publishing task is executed, on the command line.

When you want to sign the published artifacts, add the following parameters to the command line:

-Psigning.gnupg.keyName=<last-8-of-key> -Psigning.gnupg.passphrase=<key-password>

where <last-8-of-key> is the last 8 characters of the key, and <key-password> is the password for the key.

You can list the available keys using:

gpg2 -k

Documentation Site

Building

You can build the documentation website using the following:

./gradlew site

Which will build all Javadocs, User Guide, build reports and the website itself.

Publishing

Publishing the website is a bit of an odd process:

  1. Create a separate clone of the ersatz project repo with a different name (e.g. ersatz-site).
  2. In the ersatz-site repo checkout the gh-pages branch - you should see only website content in that repo now.
  3. Publish the updated site content from the main project by running: rsync -r build/site/* ../ersatz-site/
  4. In the ersatz-site project add, commit and push the changes into the gh-pages branch.

At this point the website will be published but it may take some time for GitHub to reload the changes.

License

Copyright (C) 2022 Christopher J. Stehno

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].