Skip to content

msnisha/mockware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LinkedIn


Logo

Mockware

An awesome Pega Community Hackathon 2022 Project!
Project Home · View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contact
  6. Acknowledgments

About The Project

Product Name Screen Shot

Mockware is a Pega component application with modern React JS front end to provide smart mock/stub services for Pega integrations. Before getting down to the technical, lets go through the reason for choosing the project and the benefit it brings.

The History

I wanted to use the Pega Community Hackathon 2022 as an opportunity to build something more impactful and helps to wider Pega community. Building a domains specific applications will help to demostrate Pega's features but cannot be used by as it is as eash business is unique in their process. So I choose to build a domain agnostic Pega component application which can be easily plugged in to any existingor new Pega applications across many business domain. Working in Pega more than 15 years I have built many Pega components some of them includes QR code scanner component for allowing Pega running on mobile browser to scan codes, component to support browser native push notification in Pega, A component for text extraction using teserract.

This time I choose to build a Pega component to provide a smart mock service provider component for Pega. As more and more companies prefer micro service architecture the integrations are crusial part of all the pega projects as Pega is the orchestrator for many business process applications. Many times we feel the need of stub service to unblock our development and testing.

Here's some scenario where a mock service is needed:

  • Running scheduled automation testing without mutating the actual data.
  • Missing actual data for satisfying some scenarios where testing needs to be performed
  • The actual service is not yet available, but the Pega implementation and testing needs to continue
  • Needs to easily replicate a production bug for further analyze in lower environment by mimicking the data to match production scenario.
  • Testing the applications for different behaviors when the data is not controlled by the organization something like weather data or stock market data.
  • Testing exceptional / error scenarios
  • Testing how the application reacts to performance issues from service. (By adding delays to the stub responses)

So the project Mockware born. Mockware provides the following features.

  • Reads meta data from Pega integrations and prepopulates details, allows quick creation of mock services.
  • Provide toggle buttons to enable and disable mock services for selected connectors
  • Displays the request journals to see the request has gone through the mock servers with many level of filters.
  • React JS modern frontend supports dark mode for better user experiences.
  • Provide quick fill snippets with regular expressions for completing the matching rules when creating mock services.

The Technical Details

The Mockware application includes two main component. One component is a Pega component application built in Pega 8 and the other part is a optional front end application build on React JS. The mockware application component provides a Pega portal using React JS which can be used as well instead of the external front end application built on React JS. Also Mockware application connects to the Wiremock server for hosting the stub services. Below is a simplified view of the required connectivities between each components for Mockware to work smoothly.

Deployment Diagram

Mockware front end application uses Pega basic authentication to login. It reads the list of applicable connectors based on authenticated users. It uses Pega DX API service to read the data from Pega. Mockware Pega component installed in Pega provide the needed details from Pega and also does the changes back to Pega as when user making changes through the front end application.

Mockware front end application should have the connectivity to Pega and to the Wiremock service.

(back to top)

Built With

  • Pega
  • React
  • Pega DX API
  • TypeScript
  • SaSS

(back to top)

Getting Started

Mockware contains a docker image and a Pega component application. You can download the docker image from https://hub.docker.com/r/msnisha/mockware and the product export for the Pega component application is available in this repository inside pega directory.

Prerequisites

You need to have envirornment with docker CLI installed for running docker containers for Mockware front end and wiremock server. Also Pega envirornment should be able to reach the Wiremock server for serving the data from Stub.

Installation

Here is the step by step installation instructions.

  1. Download the Pega Product file from /src/pega/Mockware_20220919T101919378_0101_20220928T084825_GMT.zip file and import in to any Pega 8.x application
  2. Add the Mockware component as one of the built on component for your pega application.
  3. Setup a wiremock server if you don't have one. (Refer Wiremock Getting starter for detail instruction). Wiremock can be installed as docker container or as a standalone server.
  4. Configure the Wiremock server endpoint in Pega. Change the dynamic system setting "MockwareSimRuleset" and "MockServiceEndpoint" for this. MockwareSimRuleset - Is the ruleset name where Mockware will create Simulated Connector Rules. MockServiceEndpoint - Wiremock server url with port
  5. Add the Mockware portal to your access group and launch the portal
  6. Your are ready to Rock 😄
  7. Optionally you can use the mockware front end application as standalone application. You can follow the steps given in docker hub to setup the Mockware front end as stand alone application. Refer https://hub.docker.com/r/msnisha/mockware

Usage

Setting up mockware will only take couple of minutes if you are familiar with docker based deployment. Once setup it will save more time to the Pega development, testing teams and as well as for users to go through the different scenario by toggling the response.

Wiremock match the request agaist define stubs based on different criteria. It allows us to create multiple conditional responses. Also mapping priority can be changed within Mockware for testing output scenarios for same input.

Also there is a delay feature can be configured for stubs in mockware response. This will allow us to test how well we handled performance delays in Pega application. Some time the integration will response faster when the volume is low and can get slower in production with high volume. Testing with slower integration response time, will give us the feeling on how the application handle the delays such as using loading icon, and showing some informative messages.

Stub services can be help is many ways in many project.

(back to top)

Roadmap

  • Intial Release of the component
  • Supports dark mode
  • Delayed response options for the stubs to test how app handles the delayed responses
  • Implement scope supporting for the mock services (Enable simulation only for selected users, access groups or at globally)
  • Complete the Recording feature to create stubs using actual integration response
  • Supporting other Connector Types (Connect-SOAP)

See the open issues for a full list of proposed features (and known issues).

(back to top)

Links

Developer - @Nish

Code Repository Link: https://github.com/msnisha/mockware

Docker Image Link: https://hub.docker.com/r/msnisha/mockware

Hackathon Page Link: https://devpost.com/software/mockware

(back to top)

Acknowledgments

The following open source projects / assets / references have been used as part of the Mockware component development.

(back to top)