Lightweight service for creating standalone mock, written in pure Kotlin with Netty container.

Related tags

Testing MockService
Overview

MockService

The lightweight service for creating a standalone mock, written in pure Kotlin with Netty container.

The service allows getting config file dynamically for runtime generating controllers to handle outside requests.

Default endpoint for uploading file is localhost:8079/config. The path could be changed in application.yml file.

Example of yaml config file:

[{ "id": 1, "type": "cat", "age": 23, "color": "red", "name": "Barsic" }] delay: 2s - request: uri: "/hello/{}/cat" method: POST response: errorCode: 403 errorMessage: Forbidden delay: 100ms ">
endpoints:
  - request:
      uri: "/hello/{}"
      method: POST
    response:
      successCode: 201
      headers:
        Content-Type: "application/json;charset=utf-8"
        Connection: "keep-alive"
        Custom-Header: "custom-header"
      body: >
        [{
          "id": 1,
          "type": "cat",
          "age": 23,
          "color": "red",
          "name": "Barsic"
        }]
      delay: 2s
  - request:
      uri: "/hello/{}/cat"
      method: POST
    response:
      errorCode: 403
      errorMessage: Forbidden
      delay: 100ms

The service also supports similar config file in json format.

With {} you can specify path variables in URI. Moreover, you can specify return body, headers or status code.

Body is presented as json format or as simple string. If body won't be specified, so server return 200 OK answer.

The service supplies to return custom success codes (by default is 200) or error code with description message.

You have opportunity to set delay in seconds or milliseconds before response will send back.

You might also like...
Strikt is an assertion library for Kotlin intended for use with a test runner such as JUnit, Minutest, Spek, or KotlinTest.

Strikt is an assertion library for Kotlin intended for use with a test runner such as JUnit, Minutest, Spek, or KotlinTest.

Fixtures for Kotlin providing generated values for unit testing

A tool to generate well-defined, but essentially random, input following the idea of constrained non-determinism.

A Kotlin Android library for heuristics evasion that prevents your code from being tested.

EvadeMe An Android library for heuristics evasion that prevents your code from being tested. User Instructions Add the maven repository to your projec

Proyecto de Kotlin y JPA sobre Hibernate, con algunos test usando JUnit 5 y Mockito.
Proyecto de Kotlin y JPA sobre Hibernate, con algunos test usando JUnit 5 y Mockito.

Contactos Kotlin JPA Ejemplos de una aplicación de manejo de contactos con Kotlin y JPA. Usando para testear la aplicación JUnit 5 y Mockito. Almacena

This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5
This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5

Kotlin-RestAssured Test Automation This is a sample API project for Rest Assured with Maven Kotlin DSL & JUnit 5 Introduction All the Test Cases kept

Android Sample Kotlin+ MVVM + Coroutines + Retrofit +Hilt+ Junit + Mockito

NTimes AppSample NY Times Most Popular Articles simple app to hit the NY Times Most Popular Articles API and show a list of articles, that shows detai

Snapshot Testing framework for Kotlin.
Snapshot Testing framework for Kotlin.

KotlinSnapshot Snapshot Testing framework for Kotlin. What is this? Snapshot testing is an assertion strategy based on the comparision of the instance

Automated tests using Rest-assured with Kotlin lang
Automated tests using Rest-assured with Kotlin lang

Testes de API em Kotlin Pré-requisitos Instalar o Kotlin Ambiente Para executar os testes localmente, estou utilizando o ServeRest Link do Repo: https

Selenium locators for Java/Kotlin that resemble the Testing Library (testing-library.com).

Selenium Testing Library Testing Library selectors available as Selenium locators for Kotlin/Java. Why? When I use Selenium, I don't want to depend on

Owner
null
FinnAds - A sample project to fetch advertisements from a mock api

FinnAds ?? FinnAds is a sample project to fetch advertisements from a mock api.

Fatih Giriş 2 Jan 27, 2022
Raccoon is a lightweight response mocking framework that can be easily integrated into the Android UI tests.

Raccoon Medium Articles Checkout these article to get more insights about this library: How to integrate this in your Android Test Why Raccoon? There

Joseph James 52 Aug 15, 2022
Simple, lightweight, modular components to help conjure your app architecture

Magic Simple, lightweight, modular components and utilities to help conjure your app architecture. Built with Kotlin coroutines to provide flexible as

TeraThought 0 Jan 9, 2022
Android library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests.

Green Coffee Green Coffee is a library that allows you to run your acceptance tests written in Gherkin in your Android instrumentation tests using the

Mauricio Togneri 227 Nov 21, 2022
Most popular Mocking framework for unit tests written in Java

Most popular mocking framework for Java Current version is 3.x Still on Mockito 1.x? See what's new in Mockito 2! Mockito 3 does not introduce any bre

mockito 13.6k Jan 4, 2023
Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project.

Kotlin API for React Test Renderer Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project. How

Xavier Cho 7 Jun 8, 2022
A multiplatform assertion library for Kotlin

Atrium is an open-source multiplatform assertion library for Kotlin with support for JVM, JS and Android. It is designed to support multiple APIs, dif

Robert Stoll 439 Dec 29, 2022
Portable validations for Kotlin

Portable validations for Kotlin ✅ Type-safe DSL ?? Multi-platform support (JVM, JS) ?? Zero dependencies Installation For multiplatform projects: kotl

null 509 Dec 18, 2022
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing

Kotest is a flexible and comprehensive testing tool for Kotlin with multiplatform support. To learn more about Kotest, visit kotest.io or see our quic

Kotest 3.8k Jan 3, 2023
mocking library for Kotlin

Kotlin Academy articles Check the series of articles "Mocking is not rocket science" at Kt. Academy describing MockK from the very basics of mocking u

MockK 4.8k Jan 3, 2023