[TEST] use ParseField instead of plain strings in query tests
This commit is contained in:
parent
0a98b5e56e
commit
2c44278ce8
|
@ -202,7 +202,7 @@ public class MoreLikeThisQueryBuilderTests extends AbstractQueryTestCase<MoreLik
|
||||||
@Override
|
@Override
|
||||||
protected Set<String> getObjectsHoldingArbitraryContent() {
|
protected Set<String> getObjectsHoldingArbitraryContent() {
|
||||||
//doc contains arbitrary content, anything can be added to it and no exception will be thrown
|
//doc contains arbitrary content, anything can be added to it and no exception will be thrown
|
||||||
return Collections.singleton("doc");
|
return Collections.singleton(MoreLikeThisQueryBuilder.Item.Field.DOC.getPreferredName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -87,6 +87,6 @@ public class ScriptQueryBuilderTests extends AbstractQueryTestCase<ScriptQueryBu
|
||||||
protected Set<String> getObjectsHoldingArbitraryContent() {
|
protected Set<String> getObjectsHoldingArbitraryContent() {
|
||||||
//script_score.script.params can contain arbitrary parameters. no error is expected when
|
//script_score.script.params can contain arbitrary parameters. no error is expected when
|
||||||
//adding additional objects within the params object.
|
//adding additional objects within the params object.
|
||||||
return Collections.singleton("params");
|
return Collections.singleton(Script.ScriptField.PARAMS.getPreferredName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,8 @@ public class FunctionScoreQueryBuilderTests extends AbstractQueryTestCase<Functi
|
||||||
protected Set<String> getObjectsHoldingArbitraryContent() {
|
protected Set<String> getObjectsHoldingArbitraryContent() {
|
||||||
//script_score.script.params can contain arbitrary parameters. no error is expected when adding additional objects
|
//script_score.script.params can contain arbitrary parameters. no error is expected when adding additional objects
|
||||||
//within the params object. Score functions get parsed in the data nodes, so they are not validated in the coord node.
|
//within the params object. Score functions get parsed in the data nodes, so they are not validated in the coord node.
|
||||||
return new HashSet<>(Arrays.asList("params", "exp", "linear", "gauss"));
|
return new HashSet<>(Arrays.asList(Script.ScriptField.PARAMS.getPreferredName(), ExponentialDecayFunctionBuilder.NAME,
|
||||||
|
LinearDecayFunctionBuilder.NAME, GaussDecayFunctionBuilder.NAME));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -171,7 +171,7 @@ public class PercolateQueryBuilderTests extends AbstractQueryTestCase<PercolateQ
|
||||||
@Override
|
@Override
|
||||||
protected Set<String> getObjectsHoldingArbitraryContent() {
|
protected Set<String> getObjectsHoldingArbitraryContent() {
|
||||||
//document contains arbitrary content, no error expected when an object is added to it
|
//document contains arbitrary content, no error expected when an object is added to it
|
||||||
return Collections.singleton("document");
|
return Collections.singleton(PercolateQueryBuilder.DOCUMENT_FIELD.getPreferredName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testRequiredParameters() {
|
public void testRequiredParameters() {
|
||||||
|
|
Loading…
Reference in New Issue