@@ -19,39 +19,39 @@ var _ = Describe("ClientUtil", func() {
1919
2020 Context ("when the backend returns status code with first digit 1 (1xx)" , func () {
2121 It ("Retry operation call is expected to be made" , func () {
22- err := ClientError {102 , "Processing" , "The request has been accepted but it's not yet complete" }
22+ err := ClientError {Code : 102 , Status : "Processing" , Description : "The request has been accepted but it's not yet complete" }
2323 result := shouldRetry (& err )
2424 Expect (result ).To (Equal (true ))
2525 })
2626 })
2727
2828 Context ("when the backend returns status code with first digit 2 (2xx)" , func () {
2929 It ("Retry operation call shouldn't be made" , func () {
30- err := ClientError {200 , "OK" , "The request has succeeded" }
30+ err := ClientError {Code : 200 , Status : "OK" , Description : "The request has succeeded" }
3131 result := shouldRetry (& err )
3232 Expect (result ).To (Equal (false ))
3333 })
3434 })
3535
3636 Context ("when the backend returns status code with first digit 3 (3xx)" , func () {
3737 It ("Retry operation call is expected to be made" , func () {
38- err := ClientError {301 , "Moved Permanently" , "URI of requested resource has been changed" }
38+ err := ClientError {Code : 301 , Status : "Moved Permanently" , Description : "URI of requested resource has been changed" }
3939 result := shouldRetry (& err )
4040 Expect (result ).To (Equal (true ))
4141 })
4242 })
4343
4444 Context ("when the backend returns status code with first digit 4 (4xx)" , func () {
4545 It ("Retry operation call is expected to be made" , func () {
46- err := ClientError {404 , "Not Found" , "The server cannot find requested resource" }
46+ err := ClientError {Code : 404 , Status : "Not Found" , Description : "The server cannot find requested resource" }
4747 result := shouldRetry (& err )
4848 Expect (result ).To (Equal (true ))
4949 })
5050 })
5151
5252 Context ("when the backend returns status code with first digit 5 (5xx)" , func () {
5353 It ("Retry operation call is expected to be made" , func () {
54- err := ClientError {500 , "Internal Server Error" , "The server got an invalid response" }
54+ err := ClientError {Code : 500 , Status : "Internal Server Error" , Description : "The server got an invalid response" }
5555 result := shouldRetry (& err )
5656 Expect (result ).To (Equal (true ))
5757 })
@@ -84,7 +84,7 @@ var _ = Describe("ClientUtil", func() {
8484 It ("Callback with retry" , func () {
8585 mockCallback := func () (interface {}, error ) {
8686 toReturn := testStruct {}
87- err := ClientError {404 , "Not Found" , "The server cannot find requesred resource" }
87+ err := ClientError {Code : 404 , Status : "Not Found" , Description : "The server cannot find requesred resource" }
8888 return toReturn , & err
8989 }
9090 result , err := CallWithRetry (mockCallback , 4 , time .Duration (0 ))
0 commit comments