@@ -31,9 +31,11 @@ func TestStub(t *testing.T) {
31
31
}
32
32
},
33
33
"output":{
34
+ "delay": "1s",
34
35
"data":{
35
36
"Hello":"World"
36
37
}
38
+
37
39
}
38
40
}`
39
41
read := bytes .NewReader ([]byte (payload ))
@@ -48,7 +50,7 @@ func TestStub(t *testing.T) {
48
50
return httptest .NewRequest ("GET" , "/" , nil )
49
51
},
50
52
handler : listStub ,
51
- expect : "{\" Testing\" :{\" TestMethod\" :[{\" Input\" :{\" equals\" :{\" Hola\" :\" Mundo\" },\" contains\" :null,\" matches\" :null},\" Output\" :{\" data\" :{\" Hello\" :\" World\" },\" error\" :\" \" }}]}}\n " ,
53
+ expect : "{\" Testing\" :{\" TestMethod\" :[{\" Input\" :{\" equals\" :{\" Hola\" :\" Mundo\" },\" contains\" :null,\" matches\" :null},\" Output\" :{\" delay \" : \" 1s \" , \" data\" :{\" Hello\" :\" World\" },\" error\" :\" \" }}]}}\n " ,
52
54
},
53
55
{
54
56
name : "find stub equals" ,
@@ -57,7 +59,7 @@ func TestStub(t *testing.T) {
57
59
return httptest .NewRequest ("POST" , "/find" , bytes .NewReader ([]byte (payload )))
58
60
},
59
61
handler : handleFindStub ,
60
- expect : "{\" data\" :{\" Hello\" :\" World\" },\" error\" :\" \" }\n " ,
62
+ expect : "{\" delay \" : \" 1s \" , \" data\" :{\" Hello\" :\" World\" },\" error\" :\" \" }\n " ,
61
63
},
62
64
{
63
65
name : "add nested stub equals" ,
@@ -290,7 +292,7 @@ func TestStub(t *testing.T) {
290
292
return httptest .NewRequest ("GET" , "/find" , bytes .NewReader ([]byte (payload )))
291
293
},
292
294
handler : handleFindStub ,
293
- expect : "{\" data\" :{\" hello\" :\" world\" },\" error\" :\" \" }\n " ,
295
+ expect : "{\" delay \" : \" 0s \" , \" data\" :{\" hello\" :\" world\" },\" error\" :\" \" }\n " ,
294
296
},
295
297
{
296
298
name : "add stub matches regex" ,
@@ -379,7 +381,7 @@ func TestStub(t *testing.T) {
379
381
return httptest .NewRequest ("GET" , "/find" , bytes .NewReader ([]byte (payload )))
380
382
},
381
383
handler : handleFindStub ,
382
- expect : "{\" data\" :{\" reply\" :\" OK\" },\" error\" :\" \" }\n " ,
384
+ expect : "{\" delay \" : \" 0s \" , \" data\" :{\" reply\" :\" OK\" },\" error\" :\" \" }\n " ,
383
385
},
384
386
{
385
387
name : "error find stub contains" ,
0 commit comments