Remove left over references to ESTestCase
This commit is contained in:
parent
ad8bf53bbd
commit
6f15f35819
|
@ -35,7 +35,6 @@ import org.elasticsearch.index.mapper.MappedFieldType;
|
|||
import org.elasticsearch.index.mapper.geo.GeoPointFieldMapper;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.indices.query.IndicesQueriesRegistry;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.elasticsearch.test.geo.RandomGeoGenerator;
|
||||
|
||||
import java.io.IOException;
|
||||
|
@ -93,9 +92,9 @@ public class GeoDistanceSortBuilderTests extends AbstractSortTestCase<GeoDistanc
|
|||
}
|
||||
if (randomBoolean()) {
|
||||
result.setNestedPath(
|
||||
ESTestCase.randomValueOtherThan(
|
||||
randomValueOtherThan(
|
||||
result.getNestedPath(),
|
||||
() -> ESTestCase.randomAsciiOfLengthBetween(1, 10)));
|
||||
() -> randomAsciiOfLengthBetween(1, 10)));
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
result.coerce(! result.coerce());
|
||||
|
@ -171,20 +170,20 @@ public class GeoDistanceSortBuilderTests extends AbstractSortTestCase<GeoDistanc
|
|||
result.unit(unit(original.unit()));
|
||||
break;
|
||||
case 4:
|
||||
result.order(ESTestCase.randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
|
||||
result.order(randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
|
||||
break;
|
||||
case 5:
|
||||
result.sortMode(mode(original.sortMode()));
|
||||
break;
|
||||
case 6:
|
||||
result.setNestedFilter(ESTestCase.randomValueOtherThan(
|
||||
result.setNestedFilter(randomValueOtherThan(
|
||||
original.getNestedFilter(),
|
||||
() -> randomNestedFilter()));
|
||||
break;
|
||||
case 7:
|
||||
result.setNestedPath(ESTestCase.randomValueOtherThan(
|
||||
result.setNestedPath(randomValueOtherThan(
|
||||
result.getNestedPath(),
|
||||
() -> ESTestCase.randomAsciiOfLengthBetween(1, 10)));
|
||||
() -> randomAsciiOfLengthBetween(1, 10)));
|
||||
break;
|
||||
case 8:
|
||||
result.coerce(! original.coerce());
|
||||
|
|
|
@ -26,7 +26,6 @@ import org.elasticsearch.common.ParsingException;
|
|||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.common.xcontent.XContentParser;
|
||||
import org.elasticsearch.index.query.QueryParseContext;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
|
@ -46,7 +45,7 @@ public class ScoreSortBuilderTests extends AbstractSortTestCase<ScoreSortBuilder
|
|||
@Override
|
||||
protected ScoreSortBuilder mutate(ScoreSortBuilder original) throws IOException {
|
||||
ScoreSortBuilder result = new ScoreSortBuilder();
|
||||
result.order(ESTestCase.randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
|
||||
result.order(randomValueOtherThan(original.order(), () -> randomFrom(SortOrder.values())));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import org.elasticsearch.index.query.QueryParseContext;
|
|||
import org.elasticsearch.script.Script;
|
||||
import org.elasticsearch.script.ScriptService.ScriptType;
|
||||
import org.elasticsearch.search.sort.ScriptSortBuilder.ScriptSortType;
|
||||
import org.elasticsearch.test.ESTestCase;
|
||||
import org.junit.Rule;
|
||||
import org.junit.rules.ExpectedException;
|
||||
|
||||
|
@ -53,20 +52,20 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
|
|||
}
|
||||
if (randomBoolean()) {
|
||||
if (type == ScriptSortType.NUMBER) {
|
||||
builder.sortMode(ESTestCase.randomValueOtherThan(builder.sortMode(), () -> randomFrom(SortMode.values())));
|
||||
builder.sortMode(randomValueOtherThan(builder.sortMode(), () -> randomFrom(SortMode.values())));
|
||||
} else {
|
||||
Set<SortMode> exceptThis = new HashSet<>();
|
||||
exceptThis.add(SortMode.SUM);
|
||||
exceptThis.add(SortMode.AVG);
|
||||
exceptThis.add(SortMode.MEDIAN);
|
||||
builder.sortMode(ESTestCase.randomValueOtherThanMany(exceptThis::contains, () -> randomFrom(SortMode.values())));
|
||||
builder.sortMode(randomValueOtherThanMany(exceptThis::contains, () -> randomFrom(SortMode.values())));
|
||||
}
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
builder.setNestedFilter(randomNestedFilter());
|
||||
}
|
||||
if (randomBoolean()) {
|
||||
builder.setNestedPath(ESTestCase.randomAsciiOfLengthBetween(1, 10));
|
||||
builder.setNestedPath(randomAsciiOfLengthBetween(1, 10));
|
||||
}
|
||||
return builder;
|
||||
}
|
||||
|
@ -102,7 +101,7 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
|
|||
break;
|
||||
case 1:
|
||||
if (original.type() == ScriptSortType.NUMBER) {
|
||||
result.sortMode(ESTestCase.randomValueOtherThan(result.sortMode(), () -> randomFrom(SortMode.values())));
|
||||
result.sortMode(randomValueOtherThan(result.sortMode(), () -> randomFrom(SortMode.values())));
|
||||
} else {
|
||||
// script sort type String only allows MIN and MAX, so we only switch
|
||||
if (original.sortMode() == SortMode.MIN) {
|
||||
|
@ -113,7 +112,7 @@ public class ScriptSortBuilderTests extends AbstractSortTestCase<ScriptSortBuild
|
|||
}
|
||||
break;
|
||||
case 2:
|
||||
result.setNestedFilter(ESTestCase.randomValueOtherThan(
|
||||
result.setNestedFilter(randomValueOtherThan(
|
||||
original.getNestedFilter(),
|
||||
() -> randomNestedFilter()));
|
||||
break;
|
||||
|
|
Loading…
Reference in New Issue