Skip to content

Commit

Permalink
Merge refactor pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
EAddario authored Apr 10, 2021
2 parents c5ea1b4 + a9252ab commit f88c8f3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The latest version is available as a Docker image at [edaddario/erised](https://
docker run --rm -p 8080:8080 edaddario/erised
```

HTTP methods (e.g. GET, POST, PATCH, etc.), query strings and body are **ignored**. URL Paths are also ignored, except for:
HTTP methods (e.g. GET, POST, PATCH, etc.), query strings and body are **ignored**. URL routes are also ignored, except for:

|Name|Purpose|
|--|--|
Expand Down Expand Up @@ -89,11 +89,12 @@ NetworkAuthenticationRequired or 511
Any other value will resolve to 200 (OK)

# Release History
* v0.3.0 - Add unit tests
* v0.3.4 - Add [gomega](https://onsi.github.io/gomega/) assertion library, refactor tests to use Ω assertions and minor bug fixes
* v0.3.0 - Add [goblin](https://github.com/franela/goblin) framework and unit tests
* v0.2.5 - Switch to zerolog logging framework, add erised/shutdown path
* v0.2.2 - Add custom headers, add dockerfile
* v0.2.1 - Add gzip compression, improve erised/headers json handling
* v0.0.3 - Add erised/headers, erised/ip and erised/info paths. Add delayed responses
* v0.0.3 - Add erised/headers, erised/ip and erised/info routes. Add delayed responses
* v0.0.2 - Add HTTP redirection status codes (300's), startup configuration parameters and request's logging
* v0.0.1 - Initial release

Expand All @@ -106,7 +107,7 @@ Of all of its deficiencies, the most notable is:
I may or may not address this in a future release. Caveat Emptor

# Motivation
When developing and testing REST based API clients, sooner or later I'd come across situations where I needed a quick and easy way to dynamically test endpoint's responses under different scenarios. Although there are many excellent frameworks and mock servers available, the time and effort required to configure them is sometimes not justified, specially if the application under test provides 10's or 100's of paths, so after some brief and unsuccessful googling I decided to create my own.
When developing and testing REST based API clients, sooner or later I'd come across situations where I needed a quick and easy way to dynamically test endpoint's responses under different scenarios. Although there are many excellent frameworks and mock servers available, the time and effort required to configure them is sometimes not justified, specially if the application under test provides 10's or 100's of routes, so after some brief and unsuccessful googling I decided to create my own.

**erised** was inspired somewhat by [Kenneth Reitz's](https://kennethreitz.org/) HTTP Request & Response Service [httpbin.io](https://httpbin.org/) and it may offer similar functionality in future releases.

Expand Down
2 changes: 1 addition & 1 deletion cmd/erised/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/rs/zerolog/log"
)

const version = "v0.3.3"
const version = "v0.3.4"

type server struct {
mux *http.ServeMux
Expand Down
2 changes: 1 addition & 1 deletion cmd/erised/serverRoutes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ func TestErisedLandingRoute(t *testing.T) {
Ω(res.Header().Get("X-Headers-Two")).Should(Equal("I'm header two"))
})

g.It("Should wait 2000ms", func() {
g.It("Should wait about 2000ms (±10ms)", func() {
res := httptest.NewRecorder()
req := httptest.NewRequest(http.MethodGet, "http://localhost:8080/", nil)
req.Header.Set("X-Erised-Response-Delay", "2000")
Expand Down

0 comments on commit f88c8f3

Please sign in to comment.