@@ -30,6 +30,7 @@ import (
30
30
. "github.com/smartystreets/goconvey/convey"
31
31
32
32
"github.com/northwesternmutual/grammes/gremconnect"
33
+ "github.com/northwesternmutual/grammes/gremerror"
33
34
)
34
35
35
36
func TestExecuteRequest (t * testing.T ) {
@@ -158,7 +159,17 @@ func TestExecuteRequestErrorRetrievingResponse(t *testing.T) {
158
159
jsonMarshalData = func (interface {}) ([]byte , error ) { return nil , errors .New ("ERROR" ) }
159
160
Convey ("Given a client that represents the Gremlin client" , t , func () {
160
161
dialer := & mockDialerStruct {}
161
- dialer .response = newVertexResponse
162
+ dialer .response = `
163
+ {
164
+ "requestId": "61616161-6161-6161-2d61-6161612d6161",
165
+ "status": {
166
+ "message": "",
167
+ "code": 597,
168
+ "attributes": {}
169
+ },
170
+ "result":{"data":null,"meta":{"@type":"g:Map","@value":[]}}
171
+ }
172
+ `
162
173
c , _ := Dial (dialer )
163
174
Convey ("When 'executeRequest' is called and retrieving the response throws an error" , func () {
164
175
bindings := make (map [string ]string )
@@ -167,6 +178,10 @@ func TestExecuteRequestErrorRetrievingResponse(t *testing.T) {
167
178
Convey ("Then the error should be returned" , func () {
168
179
So (err , ShouldNotBeNil )
169
180
})
181
+ Convey ("Then the error should be gremerror.NetworkError" , func () {
182
+ _ , ok := err .(* gremerror.NetworkError )
183
+ So (ok , ShouldBeTrue )
184
+ })
170
185
})
171
186
})
172
187
}
0 commit comments