17
17
18
18
import java .io .IOException ;
19
19
import java .util .Collections ;
20
- import java .util .Set ;
21
- import java .util .stream .Collectors ;
22
20
23
- import static org .hamcrest .Matchers .contains ;
24
21
import static org .hamcrest .Matchers .greaterThan ;
25
22
import static org .hamcrest .Matchers .notNullValue ;
26
23
@@ -37,6 +34,12 @@ public void testGetFeatures() throws IOException {
37
34
assertTrue (response .getFeatures ().stream ().anyMatch (feature -> "tasks" .equals (feature .getFeatureName ())));
38
35
}
39
36
37
+ /**
38
+ * This test assumes that at least one of our defined features should reset successfully.
39
+ * Since plugins should be testing their own reset operations if they use something
40
+ * other than the default, this test tolerates failures in the response from the
41
+ * feature reset API. We just need to check that we can reset the "tasks" system index.
42
+ */
40
43
public void testResetFeatures () throws IOException {
41
44
ResetFeaturesRequest request = new ResetFeaturesRequest ();
42
45
@@ -54,11 +57,5 @@ public void testResetFeatures() throws IOException {
54
57
assertThat (response .getFeatureResetStatuses ().size (), greaterThan (1 ));
55
58
assertTrue (response .getFeatureResetStatuses ().stream ().anyMatch (
56
59
feature -> "tasks" .equals (feature .getFeatureName ()) && "SUCCESS" .equals (feature .getStatus ())));
57
-
58
- Set <String > statuses = response .getFeatureResetStatuses ().stream ()
59
- .map (ResetFeaturesResponse .ResetFeatureStateStatus ::getStatus )
60
- .collect (Collectors .toSet ());
61
-
62
- assertThat (statuses , contains ("SUCCESS" ));
63
60
}
64
61
}
0 commit comments