File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/test/java/org/influxdb Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 39
39
import java .util .concurrent .TimeUnit ;
40
40
import java .util .concurrent .atomic .LongAdder ;
41
41
import java .util .function .Consumer ;
42
+ import java .util .regex .Pattern ;
42
43
43
44
/**
44
45
* Test the InfluxDB API.
@@ -208,9 +209,11 @@ public void testCallbackQueryFailureHandling() throws Throwable {
208
209
Assertions .fail ("Malformed query should throw InfluxDBException" );
209
210
}
210
211
catch (InfluxDBException e ){
211
- Assertions .assertTrue (e .getMessage ().matches ("Bad Request[\\ s-a-zA-Z{}:\" ,0-9]*error parsing query: " +
212
- "found SERRIES, expected[\\ s-a-zA-Z{}:\" ,0-9]*" ),
213
- "Error string not expected" );
212
+ Pattern errorPattern = Pattern .compile ("Bad Request.*error parsing query: found SERRIES, expected.*" ,
213
+ Pattern .DOTALL );
214
+
215
+ Assertions .assertTrue (errorPattern .matcher (e .getMessage ()).matches (),
216
+ "Error string \" " + e .getMessage () + "\" does not match error pattern" );
214
217
}
215
218
}
216
219
You can’t perform that action at this time.
0 commit comments