|
|
@@ -158,10 +158,10 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
*/
|
|
|
public void testUnknownArrayNameExpection() throws IOException {
|
|
|
{
|
|
|
- IllegalArgumentException e = expectParseThrows(IllegalArgumentException.class, "{\n" +
|
|
|
+ XContentParseException e = expectParseThrows(XContentParseException.class, "{\n" +
|
|
|
" \"bad_fieldname\" : [ \"field1\" 1 \"field2\" ]\n" +
|
|
|
"}\n");
|
|
|
- assertEquals("[highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
+ assertEquals("[2:5] [highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
}
|
|
|
|
|
|
{
|
|
|
@@ -174,7 +174,7 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
"}\n");
|
|
|
assertThat(e.getMessage(), containsString("[highlight] failed to parse field [fields]"));
|
|
|
assertThat(e.getCause().getMessage(), containsString("[fields] failed to parse field [body]"));
|
|
|
- assertEquals("[highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
+ assertEquals("[4:9] [highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -188,10 +188,10 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
*/
|
|
|
public void testUnknownFieldnameExpection() throws IOException {
|
|
|
{
|
|
|
- IllegalArgumentException e = expectParseThrows(IllegalArgumentException.class, "{\n" +
|
|
|
+ XContentParseException e = expectParseThrows(XContentParseException.class, "{\n" +
|
|
|
" \"bad_fieldname\" : \"value\"\n" +
|
|
|
"}\n");
|
|
|
- assertEquals("[highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
+ assertEquals("[2:5] [highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
}
|
|
|
|
|
|
{
|
|
|
@@ -204,7 +204,7 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
"}\n");
|
|
|
assertThat(e.getMessage(), containsString("[highlight] failed to parse field [fields]"));
|
|
|
assertThat(e.getCause().getMessage(), containsString("[fields] failed to parse field [body]"));
|
|
|
- assertEquals("[highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
+ assertEquals("[4:9] [highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -213,10 +213,10 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
*/
|
|
|
public void testUnknownObjectFieldnameExpection() throws IOException {
|
|
|
{
|
|
|
- IllegalArgumentException e = expectParseThrows(IllegalArgumentException.class, "{\n" +
|
|
|
+ XContentParseException e = expectParseThrows(XContentParseException.class, "{\n" +
|
|
|
" \"bad_fieldname\" : { \"field\" : \"value\" }\n \n" +
|
|
|
"}\n");
|
|
|
- assertEquals("[highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
+ assertEquals("[2:5] [highlight] unknown field [bad_fieldname], parser not found", e.getMessage());
|
|
|
}
|
|
|
|
|
|
{
|
|
|
@@ -229,7 +229,7 @@ public class HighlightBuilderTests extends ESTestCase {
|
|
|
"}\n");
|
|
|
assertThat(e.getMessage(), containsString("[highlight] failed to parse field [fields]"));
|
|
|
assertThat(e.getCause().getMessage(), containsString("[fields] failed to parse field [body]"));
|
|
|
- assertEquals("[highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
+ assertEquals("[4:9] [highlight_field] unknown field [bad_fieldname], parser not found", e.getCause().getCause().getMessage());
|
|
|
}
|
|
|
}
|
|
|
|