the mock backend for frontend applications

Related tags

Testing mockend
Overview

mockend

the "mock backend" for Single Page Applications (SPAs) / Progressive Web Applications (PWAs).

mockend was used to implement the "unidirectional dataflow" and asynchronous data fetching in the https://github.com/adambien/bce.design template.

install

curl -L -O https://github.com/AdamBien/mockend/releases/download/[LATEST_RELEASE]/mockend-runner.jar

e.g. for the v0.0.1:

curl -L -O https://github.com/AdamBien/mockend/releases/download/v0.0.1/mockend-runner.jar

run

Install Java 11+ first, then run:

java -jar target/mockend-runner.jar

API

Checkout: http://localhost:8080/q/swagger-ui/

All requests can be delayed for the time defined in the header: delay-in-ms

Create Read Update Delete (CRUD)

creation with generated id

request: curl -XPOST "http://localhost:8080/crud" -H "Content-Type: application/json" -d "{\"message\":\"hello, mockend\"}"

response:

access-control-allow-credentials: false 
access-control-allow-origin: http://localhost:8080 
content-length: 0 
location: http://localhost:8080/crud/1618928997430

fetch an existing object

request: curl http://localhost:8080/crud/1618928997430 response:

{"message":"hello, mockend","id":"1618928997430"}

fetch an existing object with a delay

request with a response delayed for 1000 ms:

curl -H'delay-in-ms:1000' http://localhost:8080/crud/1618928997430

delete a record

request:

curl -XDELETE http://localhost:8080/crud/1618928997430

response:

HTTP/1.1 204 No Content

create an object with id

request:

curl -X PUT "http://localhost:8080/crud/42" -H "Content-Type: application/json" -d "{\"message\":\"hello,mockend\"}"

response:

HTTP/1.1 201 Created
Content-Length: 0
Location: http://localhost:8080/crud/42

subsequent PUTwith the same id:

request:

curl -X PUT "http://localhost:8080/crud/42" -H "Content-Type: application/json" -d "{\"message\":\"hello,mockend\"}"

response:

HTTP/1.1 204 No Content

echo

request:

curl -X POST "http://localhost:8080/echo" -H"Content-Type: text/plain" -d "hello, mockend"

response:

HTTP/1.1 200 OK
Content-Length: 19
Content-Type: text/plain;charset=UTF-8

echo:hello, mockend

request with a response delayed for 1000 ms:

curl -i -X POST "http://localhost:8080/echo" -H'delay-in-ms:1000' -H"Content-Type: text/plain" -d "hello, mockend"

status

The /statuses API returns responses with status codes passed as status header and a + in the body, e.g.

request:

curl -H"status: 500" http://localhost:8080/statuses response:

HTTP/1.1 500 Internal Server Error
Content-Length: 1

+

POST, PUT, GET, DELETE, OPTIONS requests are supported.

Server Sent Events (SSE)

All CRUD methods are intercepted and streamed as SSE events:

request:

curl -N http://localhost:8080/sse

response:

: crud-events
event: crud-event
id: 1620452701200
data: {"httpMethod":"POST","path":"/","payload":{"hello":"world","id":"1620452701199"}}

build

mvn package

references

This repository contains code extracted from: https://github.com/AdamBien/snail and https://github.com/AdamBien/statustest

mockend was created to test: https://github.com/AdamBien/bce.design and also used at: https://airhacks.live workshops

You might also like...

JVM version of Pact. Enables consumer driven contract testing, providing a mock service and DSL for the consumer project, and interaction playback and verification for the service provider project.

pact-jvm JVM implementation of the consumer driven contract library pact. From the Ruby Pact website: Define a pact between service consumers and prov

Dec 31, 2022

Mock for RabbitMQ Java amqp-client

Mock for RabbitMQ Java amqp-client

RabbitMQ-mock Mock for RabbitMQ Java amqp-client. Compatible with versions 4.0.0 to 5.9.0 of com.rabbitmq:amqp-client Compatible with versions 3.6.3 t

Dec 28, 2022

An expressive Mock Object library for Test Driven Development

JMock Library Maven dependency groupIdorg.jmock/groupId artifactIdjmock-junit5/artifactId version2.12.0/version scope

Aug 23, 2022

Xposed module to hide the mock location setting

Hide Mock Location is an Xposed Module (now LSPosed on Android 11), which hides information about the 'Allow mock locations' setting.

Dec 15, 2022

Share the chat messages across Minecraft Servers via HTTP backend powered by Spring Boot, this is the backend part of the project.

InterconnectedChat-Backend Share the chat messages across Minecraft Servers via HTTP backend powered by Spring Boot, this is the backend part of the p

Oct 6, 2021

Java GUI Frontend for XCH Forks

Java GUI Frontend for XCH Forks

ForkFarmer Java GUI Frontend for XCH Forks. Discord: https://discord.gg/Mx9ZNHta Requires JRE 1.8 or greater to run: https://www.java.com/en/download/

Nov 8, 2022

Angular Final Assignment - Keep Note frontend

Angular Final Assignment - Keep Note frontend Objective The Objective of this level of Keep is to cover the following areas : Components Design Compon

Jan 29, 2022

This is the RestFul API using SpringBoot made to integrate the frontend of this repository.

This is the RestFul API using SpringBoot made to integrate the frontend of this repository. Requirements For building and running the application you

Jan 21, 2022

Spring for GraphQL demo project with a Vue frontend.

Spring Books - Hello GraphQL This is a demo project that will introduce you to [https://spring.io/projects/spring-graphql](Spring for GraphQL). The Sp

Dec 2, 2022

To quickly integrate your applications into the EdgeGallery platform, we provide the toolchain project to help developers quickly modify code and migrate applications to the platform.

Toolchain 工具链 工具链是MEC Developer开发者平台中的一个重要特性,当x86平台的App想要上车ARM平台时,底层的代码不可避免的需要进行修改或重写。 App提供者可以通过MEC Developer开发者平台中集成的工具链进行源代码分析,定位需要修改的源代码并根据指导意见进行修

Jan 7, 2022

OpenMap is an Open Source JavaBeans-based programmer's toolkit. Using OpenMap, you can quickly build applications and applets that access data from legacy databases and applications.

$Source: /cvs/distapps/openmap/README,v $ $RCSfile: README,v $ $Revision: 1.11 $ $Date: 2002/11/06 19:11:02 $ $Author: bmackiew $ OpenMap(tm) What

Nov 12, 2022

An implementation of darcy-web that uses Selenium WebDriver as the automation library backend.

darcy-webdriver An implementation of darcy-ui and darcy-web that uses Selenium WebDriver as the automation library backend. maven dependency gr

Aug 22, 2020

The backend service for user management module of EdgeGallery platform.

User Management 用户管理 User Management 用户管理模块,为EdgeGallery提供了基本的用户增删改查功能,定义了用户的角色与权限,并且包含了两个关键特性:手机验证和单点登录(Single Sign On)能力。 角色定义 租户 系统内的普通用户,可以创建项目/上传

Dec 25, 2021

The backend service for appstore module of EdgeGallery platform

AppStore-be AppStore是开发者发布和上线App应用的市场,上传App包后首先要通过测试,只有检测通过的应用才能够正式上线。AppStore分为前后台两个部分,AppStore-be是后台部分,提供接口调用, AppStore-fe是前台部分,提供界面展示。有关AppStore架构的

Oct 21, 2022

The backend service for developer module of EdgeGallery platform

Developer-be 开发者平台 开发者平台是为App开发者提供开发工具/测试环境/上线部署的平台,分为前后台两个部分,developer-be是后台部分,提供接口调用,developer-fe是前台部分,提供界面展示。有关开发者平台的架构的详细介绍请访问我们的wiki社区 特性介绍 为了方便开

Jan 11, 2022

Backend for HR Admin Console with Spring Boot

HR-ADMIN 后台管理系统 项目简介 一个基于 Spring Boot 2.1.0 、 Spring Boot Jpa、 JWT、Spring Security、Redis、Vue 的前后端分离的后台管理系统 默认账号密码: admin / 123456 主要特性 使用最新技术栈,社区资源丰富。

Feb 14, 2021

A backend service for EdgeGallery application testing and verification

ATP-BE ATP (Application test platform)是应用测试认证的平台,通过构建统一的测试标准并搭建测试框架,为开发者平台与APPStore提供一致的APP测试体验 特性介绍 上传、管理App 编译运行 atp-be对外提供restful接口,基于开源的ServiceCom

Jan 10, 2022
Comments
  • Question about PostConstruct initialization

    Question about PostConstruct initialization

    Hi Adam,

    out of curiosity, what is the reason for initializing the HashMap in the @PostConstruct method here instead of doing a field or constructor initialization?

    public class CRUDResource {
    
        Map<String, JsonObject> store;
        
        @PostConstruct
        public void init() {
            this.store = new HashMap<>();
        }
    
    }
    

    Thanks

    opened by mklueh 2
Releases(v0.0.3)
Owner
Adam Bien
I'm working with Java technology since JDK 1.0 and with JavaScript since LiveScript. Sometimes I deliver live, virtual workshops: airhacks.live
Adam Bien
The MAVLink parser for the Telestion backend.

telestion-extension-template A template for creating new Telestion extensions. This template contains an initialized project structure with configured

WüSpace e. V. 3 Dec 14, 2021
Um projeto simples usando Serenity BDD desenvolvido para testes backend.

?? EM CONSTRUÇÂO ?? Um pouco sobre Serenity e o projeto desenvolvido Serenity_BDD é uma biblioteca de código aberto que visa tornar a ideia de documen

null 10 Aug 30, 2022
Um projeto simples usando Serenity BDD desenvolvido para testes backend.

?? EM CONSTRUÇÂO ?? Um pouco sobre Serenity e o projeto desenvolvido Serenity_BDD é uma biblioteca de código aberto que visa tornar a ideia de documen

null 10 Aug 30, 2022
Toolkit for testing multi-threaded and asynchronous applications

ConcurrentUnit A simple, zero-dependency toolkit for testing multi-threaded code. Supports Java 1.6+. Introduction ConcurrentUnit was created to help

Jonathan Halterman 406 Dec 30, 2022
Apache JMeter - An Open Source Java application designed to measure performance and load test applications

An Open Source Java application designed to measure performance and load test applications. By The Apache Software Foundation What Is It? Apache JMete

The Apache Software Foundation 6.7k Jan 1, 2023
In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend

In this course, we will learn how to build a complete full-stack web application using Spring boot as backend and React (React Hooks) as frontend. We will use MySQL database to store and retrieve the data.

Ramesh Fadatare 43 Dec 22, 2022
Frontend : React , Backend : Spring boot

React(Front) + Spring Boot(Back) 작업 하기 앞서, React와 Spring Boot는 각각 다른 서버에서 돌아가기 때문에, 연동시 Front에 문제가 생기면 Back까지 문제가 생길 수 있다. 하지만, Spring Boot에서 React와 같

심재철 2 Jan 9, 2022
There are two challenges one is to create a backend api the other is to create a frontend application to consume the public data api devall.

Sobre | Desafio | Resolução | Tecnologias | Execução | Itexto desafio tecnico Sobre os Desafios existem dois desafios um é criar uma api backend o out

fabricio S Miranda 1 Oct 18, 2021
Projeto criado no Santander Dev Week 2022 + DIO com o intuito de desenvolver uma camada de APIs (backend) que será utilizada pelo frontend.

Santader Dev Week + DIO 2022 - APIs Backend da aplicação de movimentação financeira Este repositório contém o backend da aplicação que foi desenvolvid

Pedro Antunes Negrão 2 Sep 7, 2022
Application for creating blog posts, developed with Java using Spring Framework for backend and Angular along with PrimeNG Library for frontend development.

Application for creating blog posts, developed with Java using Spring Framework for backend and Angular along with PrimeNG Library for frontend development.

Áureo Carmelino 10 Nov 27, 2022