@@ -44,9 +44,10 @@ func TestErrorAvgMissingField(t *testing.T) {
44
44
LogMessageField : "line" ,
45
45
LogLevelField : "lvl" ,
46
46
}
47
- _ , err := queryDataTestWithResponseCode ( query , 400 , response , configuredFields )
48
- // FIXME: add asserts to also test the result is containing an error with the 400 status code
47
+
48
+ result , err := queryDataTestWithResponseCode ( query , 400 , response , configuredFields )
49
49
require .Nil (t , err )
50
+ require .Contains (t , result .response .Responses ["A" ].Error .Error (), "\" status\" :400" )
50
51
}
51
52
52
53
func TestErrorAvgMissingFieldNoDetailedErrors (t * testing.T ) {
@@ -76,9 +77,10 @@ func TestErrorAvgMissingFieldNoDetailedErrors(t *testing.T) {
76
77
LogMessageField : "line" ,
77
78
LogLevelField : "lvl" ,
78
79
}
79
- _ , err := queryDataTestWithResponseCode ( query , 400 , response , configuredFields )
80
- // FIXME: add asserts to also test the result is containing an error with the 400 status code
80
+
81
+ result , err := queryDataTestWithResponseCode ( query , 400 , response , configuredFields )
81
82
require .Nil (t , err )
83
+ require .Contains (t , result .response .Responses ["A" ].Error .Error (), "\" status\" :400" )
82
84
}
83
85
84
86
func TestErrorTooManyDateHistogramBuckets (t * testing.T ) {
@@ -160,7 +162,8 @@ func TestNonElasticError(t *testing.T) {
160
162
LogMessageField : "line" ,
161
163
LogLevelField : "lvl" ,
162
164
}
163
- _ , err := queryDataTestWithResponseCode ( query , 403 , response , configuredFields )
164
- // FIXME: add asserts to also test the result is containing an error with the 403 status code
165
+
166
+ result , err := queryDataTestWithResponseCode ( query , 403 , response , configuredFields )
165
167
require .Nil (t , err )
168
+ require .Contains (t , result .response .Responses ["A" ].Error .Error (), "\" status\" :403" )
166
169
}
0 commit comments