Skip to content

Commit

Permalink
removed test convey messages that referred to rchttp
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidSubiros committed Apr 14, 2020
1 parent 05346fa commit 2459199
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/ONSdigital/dp-net
go 1.13

require (
github.com/ONSdigital/go-ns v0.0.0-20191104121206-f144c4ec2e58
github.com/ONSdigital/log.go v1.0.0
github.com/facebookgo/freeport v0.0.0-20150612182905-d4adf43b75b9
github.com/justinas/alice v1.2.0
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
github.com/ONSdigital/dp v0.0.0-20200403131604-612f82ba3fef h1:ghq+sp03mQHi7DpYH0g6IUmPhb0GefSWAOpg0HcxqTc=
github.com/ONSdigital/go-ns v0.0.0-20191104121206-f144c4ec2e58 h1:XHnzoC7TxueLAfkBpblPiwaIxjngGv1VNVZhvE4jY6w=
github.com/ONSdigital/go-ns v0.0.0-20191104121206-f144c4ec2e58/go.mod h1:iWos35il+NjbvDEqwtB736pyHru0MPFE/LqcwkV1wDc=
github.com/ONSdigital/log.go v1.0.0 h1:hZQTuitFv4nSrpzMhpGvafUC5/8xMVnLI0CWe1rAJNc=
Expand Down
18 changes: 9 additions & 9 deletions http/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func TestHappyPaths(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given a default rchttp client and happy paths", t, func() {
Convey("Given a default client and happy paths", t, func() {
httpClient := NewClient()

Convey("When Get() is called on a URL", func() {
Expand Down Expand Up @@ -102,7 +102,7 @@ func TestClientDoesRetry(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with small client timeout", t, func() {
Convey("Given a client with small client timeout", t, func() {
// force client to abandon requests before the requested one second delay on the (next) server response
httpClient := ClientWithTimeout(nil, 100*time.Millisecond)

Expand Down Expand Up @@ -134,7 +134,7 @@ func TestClientDoesRetryAndContextCancellation(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with small client timeout", t, func() {
Convey("Given a client with small client timeout", t, func() {
// force client to abandon requests before the requested one second delay on the (next) server response
httpClient := ClientWithTimeout(nil, 500*time.Millisecond)
Convey("When Post() is called on a URL with a delay on the first response", func() {
Expand Down Expand Up @@ -164,7 +164,7 @@ func TestClientDoesRetryAndContextTimeout(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with small client timeout", t, func() {
Convey("Given a client with small client timeout", t, func() {
// force client to abandon requests before the requested one second delay on the (next) server response
httpClient := ClientWithTimeout(nil, 500*time.Millisecond)
Convey("When Post() is called on a URL with a delay on the first response", func() {
Expand All @@ -190,7 +190,7 @@ func TestClientNoRetries(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with no retries", t, func() {
Convey("Given a client with no retries", t, func() {
httpClient := ClientWithTimeout(nil, 100*time.Millisecond)
httpClient.SetMaxRetries(0)

Expand All @@ -207,7 +207,7 @@ func TestClientNoRetries(t *testing.T) {

func TestClientHandlesUnsuccessfulRequests(t *testing.T) {

Convey("Given an rchttp client with no retries", t, func() {
Convey("Given a client with no retries", t, func() {
httpClient := ClientWithTimeout(nil, 5*time.Second)
httpClient.SetMaxRetries(0)

Expand Down Expand Up @@ -258,7 +258,7 @@ func TestClientHandlesUnsuccessfulRequests(t *testing.T) {
})
})

Convey("Given an rchttp client with retries", t, func() {
Convey("Given a client with retries", t, func() {
httpClient := ClientWithTimeout(nil, 5*time.Second)
httpClient.SetMaxRetries(1)

Expand Down Expand Up @@ -297,7 +297,7 @@ func TestClientAddsRequestIDHeader(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with no correlation ID in context", t, func() {
Convey("Given a client with no correlation ID in context", t, func() {
// throw in a check for wrapped client instantiation
httpClient := ClientWithTimeout(nil, 5*time.Second)

Expand Down Expand Up @@ -327,7 +327,7 @@ func TestClientAppendsRequestIDHeader(t *testing.T) {
defer ts.Close()
expectedCallCount := 0

Convey("Given an rchttp client with existing correlation ID in context", t, func() {
Convey("Given a client with existing correlation ID in context", t, func() {
upstreamRequestID := "call1234"
// throw in a check for wrapped client instantiation
httpClient := ClientWithTimeout(nil, 5*time.Second)
Expand Down

0 comments on commit 2459199

Please sign in to comment.