Skip to content

Commit

Permalink
[Transform] Add an assertion to the testTransformFeatureReset test case
Browse files Browse the repository at this point in the history
  • Loading branch information
przemekwitek committed Oct 4, 2023
1 parent 22a0ae1 commit 8b54455
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.Response;
import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.support.XContentMapValues;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.search.aggregations.AggregationBuilders;
import org.elasticsearch.search.aggregations.AggregatorFactories;
Expand Down Expand Up @@ -43,7 +44,9 @@ public void setLogging() throws IOException {
{
"persistent": {
"logger.org.elasticsearch.xpack.core.indexing.AsyncTwoPhaseIndexer": "debug",
"logger.org.elasticsearch.xpack.transform": "trace"
"logger.org.elasticsearch.xpack.transform": "trace",
"logger.org.elasticsearch.xpack.transform.notifications": "debug",
"logger.org.elasticsearch.xpack.transform.transforms": "debug"
}
}""");
client().performRequest(settingsRequest);
Expand Down Expand Up @@ -100,6 +103,16 @@ public void testTransformFeatureReset() throws Exception {
// assert transforms are gone
assertThat((Integer) getTransforms("_all").get("count"), equalTo(0));

// assert transform documents are gone
Map<String, Object> transformIndicesContents = ESRestTestCase.entityAsMap(
adminClient().performRequest(new Request("GET", ".transform-*/_search"))
);
assertThat(
"Indices contents were: " + transformIndicesContents,
XContentMapValues.extractValue(transformIndicesContents, "hits", "total", "value"),
is(equalTo(0))
);

// assert transform indices are gone
assertThat(ESRestTestCase.entityAsMap(adminClient().performRequest(new Request("GET", ".transform-*"))), is(anEmptyMap()));
}
Expand Down

0 comments on commit 8b54455

Please sign in to comment.