KoMock - Simple HTTP/Consul/SpringConfig http server framework written in Kotlin. Wiremock use cases

Overview

Komock Build Status GitHub license Maven Central Code Climate

Here is HTTP/Consul/SpringConfig mocker framework written in Kotlin.

This tiny framework is very useful if you need to create REST based client for API service.
We use this framework for develop microservices or API integration with third party systems.

Main features:

  • Configurable response for any kind of HTTP request/response with wildcards, cookies and custom headers.
  • SSL support
  • Virtual Host support
  • Consul discovery service support.
  • Ability to work like a simple Spring Configuration Server
  • Header based security
  • Variables in the response by request parameters
  • Callback support

Download

Binaries are available at https://github.com/laviua/komock/releases/latest

Changelog

Maven Central repository

<dependency>
    <groupId>ua.com.lavi</groupId>
    <artifactId>komock-core</artifactId>
    <version>RELEASE</version>
</dependency>

How to use

Run standalone application:

  1. Extract release version from https://github.com/laviua/komock/releases/latest :

     komock-app-x.x.x.zip
    
  2. Run

     bin\komock-app /path/your_config.yaml
    

Examples

Simple http server https://github.com/laviua/komock/wiki/Simple-http-server-(Java)

Oauth2 server https://github.com/laviua/komock/wiki/Oauth2-server

Consul service registration https://github.com/laviua/komock/wiki/Consul

Spring config server https://github.com/laviua/komock/wiki/Spring-config-server

Unit testing https://github.com/laviua/komock/wiki/Unit-Testing-with-request-capturing-(Java)

Full config Callbacks, Mask patterns, cookies, virtualhosts, etc Look at self-describable configuration file Link:

HTTPS / SSL:

You can use your personal keystore. Just create it by the following command and set filename with password in the configuration file (secure section):

keytool -genkey -alias replserver -keyalg RSA -keystore mock_keystore.jks -dname "CN=Mark Smith, OU=JavaSoft, O=Sun, L=Cupertino, S=California, C=US" -storepass mockpassword -keypass mockpassword

ssl:
  enabled: true
  keyStoreLocation: mock_keystore.jks
  keyStorePassword: mockpassword

License

Licensed under Apache 2 License

Comments
  • Mention the latest version as 1.10.0

    Mention the latest version as 1.10.0

    I see that we can get release info from this page : https://github.com/laviua/komock/releases/latest , but it shows version as 1.10 which is not the exact version present in the maven central repo . After some checking I realized the complete correct version is 1.10.0, I think it would be useful to put this in the readme, or change the release info in the releases or completely change the release including the tag?

    opened by karuppiah7890 1
  • Create record and playback request feature

    Create record and playback request feature

    In this feature, i want to use run application in the proxy mode. Proxy should forward requests into the target host and write the routes configuration in komock format into the file.

    Records in the target file should be compatible with the komock route configuration. Eventually i want to copy paste records into the main configiration.

    enhancement 
    opened by laviua 0
  • Release 1.6.1

    Release 1.6.1

    • Add variables for log request/response
    • Add request counter
    • Add delay for response
    • Add documentation and unit tests
    • Remove kotlinx package
    • Refactoring
    opened by laviua 0
  • Add route parameters

    Add route parameters

    Framework should work with parametrized http routes. "/service/?name=Steve&lastname=Jobs" for example it can be replaced by template in the response "Hello, ${name} ${lastname}" to "Hello, Steve Jobs"

    enhancement 
    opened by laviua 0
  • Release 1.0.3

    Release 1.0.3

    Remove default body when mapping is not found (404) #7 Remove Server header #8 Remove daemon mode parameter Refactoring. Handle bind exception. Log refactoring. Enable colors.

    opened by laviua 0
Releases(1.10)
Owner
Oleksandr L
Software Engineer
Oleksandr L
CovidTracker traces all the covid-19 cases all over the world.

CovidTracker Crona Tracker trace india covid-19 cases upto district level and can trace other countries cases too. It can also traces user's current l

Anuraj Jain 6 May 22, 2021
Provides Ktor Server libs for building awesome Kotlin plugins which needs to provide builtin HTTP servers

Ktor Plugin Provides Ktor Server libs for building awesome Kotlin plugins which needs to provide builtin HTTP servers. Requires: https://github.com/Po

null 0 Nov 13, 2021
Jambeez-server - Jambeez server with kotlin

jambeez-server How to start Start your own server with: docker pull ghcr.io/jamb

null 5 Apr 2, 2022
A server which delivers client configuration settings to an end-user over http.

RuneTopic HTTP Server A server which delivers client configuration settings to an end-user over http. Setup Guide You can host a http server with Dock

Runetopic 2 Dec 1, 2021
Allowing server admins to backdoor their own server!

DiscordBackdoorBot Allowing server admins to backdoor their own server! What does Discord Backdoor Bot do? Discord Backdoor bot allows the bot owner t

Awesomemoder316 1 Jun 8, 2022
The Okila server project uses the Spring boot framework and uses the Kotlin language

Okila-Server The Okila server project uses the Spring boot framework and uses the Kotlin language Format Response //The response successfully format

Nankai 1 Oct 25, 2021
Karpet is a work in progress minestom server written for vanilla

Karpet Karpet is a work in progress minestom server written for vanilla Features Crafting support, with easy support to add recipes Smelting support,

Karpet Powered 5 Oct 1, 2022
an open source algorithmic trading framework written in Kotlin for anyone serious about algo-trading

Roboquant Roboquant is an algorithmic trading platform that is fast and flexible while at the same time strives to be easy to use. It is fully open so

Neural Layer 132 Jan 2, 2023
LittleKt - An OpenGL game framework written in Kotlin

LittleKt - A 2D game framework written in Kotlin Currently in development. Littl

LittleKt 128 Dec 31, 2022
KotlinDL - High-level Deep Learning Framework written in Kotlin and inspired by Keras

Оригинальный репозиторий https://github.com/JetBrains/KotlinDL KotlinDL: High-le

Temur Yunusov 1 Feb 4, 2022
sample project that shows you how you can use Ktor to creat a server for real Project.

Ktor-Sample This is a sample project that shows you how you can use Ktor to creat a server for real Project. What is done Save data to database (Get a

Mohamed Emad 4 Dec 23, 2022
🍣✨ Simple Ktor server to handle GitHub -> YouTrack, usually for YouTrack Standalone.

?? sushi Simple Ktor server to handle GitHub Issues to YouTrack, usually for YouTrack Standalone. Why? There is not really a definite way to handle Gi

Noelware 2 Nov 11, 2021
Simple addon for BlueMap that allows using a custom skin server.

BlueMap Custom Skin Server Description Simple addon for BlueMap that allows using a custom skin server. Config { "debug": false,

Syorito Hatsuki 3 Nov 13, 2022
A simple MVI framework for Kotlin Multiplatform and Android

Orbit Multiplatform Get in touch What is Orbit Orbit is a Redux/MVI-like library - but without the baggage. It's so simple we think of it as MVVM+. Si

null 521 Jan 1, 2023
A simple android Twitter client written in Kotlin

Blum Blum is an unofficial, simple, fast Twitter client written in Kotlin. This project is a complete rewrite of the Java version. Screenshot Build To

Andrea Pivetta 77 Nov 29, 2022
Tictactoe-android-app - Simple TicTacToe Android app written in Kotlin

TicTacToe Android App This is a simple example of TicTacToe game as Android app

Blaž Čerpnjak 1 Jul 9, 2022
Repository with source code from http://rosettacode.org/wiki/Category:Kotlin

Rosetta Code Kotlin This is a repository with the Kotlin source code from RosettaCode wiki. The main motivation for extracting all the code into a rep

Dmitry Kandalov 20 Dec 27, 2022
Webclient-kotlin-sample - An example of using the http web client to promote synchronous and asynchronous https calls

Web Client Consumer Kotlin Sample The project is an example of using the http we

null 1 May 1, 2022
A kotlin based server for the milky store mobile application

Milky Store backend server A kotlin ?? ?? based backend server to power up the milky store android application FEATURES : Secure serialisation ?? lead

The X 3 Oct 21, 2021