Skip to content

grinfeld/redirect-to-stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

97 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Code Quality: Java Total Alerts Quality Gate Status

Redirect-To-Stream

Small web server that receives http requests and redirect them to any (reactive) subscriber

and few other useful for tests use cases

The original purpose is - writing integration tests.

Subscribers flow

Supported GET and POST

Tests subscribe to possible 4 end-points (supporting only: application/x-json-stream for streaming or single requests with application/json) :

  • /subscribe/http/all - redirects to subscriber any request received by server
  • /subscribe/http/uri/{uri} - filters requests by URI
  • /subscribe/http/method/{method} - filters requests by http method
  • /subscribe/http/filter/{method}/{uri} - filters requests by uri and http method

Service (or some pipeline that ends with sending HttpRequest) we want to test should send/redirect requests to:

  • /receive/get/{any uri}
  • /receive/post/{any uri}
  • /receive/put/{any uri}

Test different HttpStatuses

There are 2 options:

  1. global
  2. per endpoint

Global

We defined 2 parameters: status (i.e. different from 200) and change frequency counter (a.k.k.a how often we return status)

Default values are: for status = 404 and freqCounter = 10 - means every 10th request server returns status 404

Initial values defined in application.yml file (but it could be changed on the fly - see later)

Supported GET and POST

End Point to send requests to: /status/global/{any uri suffix}

End Point to change default global: /global/change/status/{status}/freq/{freq} - change of this values will affect anyone who uses end point above

Per Endpoint

Same logic, but you can define status and change frequency inside end point url

/status/{status}/freq/{freq}/{/get:.}* - self explained (if not open me bug :) )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published