Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.vectron-systems:imposter:v0.5.0'
}
dependencies {
implementation("com.github.vectron-systems:imposter:v0.5.0")
}
<dependency>
<groupId>com.github.vectron-systems</groupId>
<artifactId>imposter</artifactId>
<version>v0.5.0</version>
</dependency>
libraryDependencies += "com.github.vectron-systems" % "imposter" % "v0.5.0"
:dependencies [[com.github.vectron-systems/imposter "v0.5.0"]]
Reliable, scriptable and extensible mock server for general REST APIs, OpenAPI (aka Swagger) specifications, Salesforce and HBase APIs.
Scripting support for both JavaScript or Groovy/Java.
Use Imposter to:
Provide mock responses using static files or customise behaviour using JavaScript or Java/Groovy. Power users can write their own plugins in a JVM language of their choice.
The quickest way to get up and running is to use our free cloud-hosted version at https://www.remotebot.io/mocks
Imposter uses plugins to control its behaviour and provide specialised mocks:
You can also create your own plugins, using a JVM language of your choice.
Let's assume your configuration is in a folder named config
.
Docker example:
docker run -ti -p 8443:8443 \
-v $(pwd)/config:/opt/imposter/config \
outofcoffee/imposter-rest
Standalone Java example:
java -jar distro/build/libs/imposter.jar \
--plugin com.gatehill.imposter.plugin.rest.RestPluginImpl \
--configDir ./config
Your mock server is now running!
This example starts a mock server using the simple
REST plugin, serving responses based on the configuration files
inside the config
folder. You can hit the URL
http://localhost:8443/example to see the mock response.
For recent changes see the Changelog, or view the Roadmap.
Pull requests are welcome.
Pete Cornish (outofcoffee@gmail.com)