File tree 1 file changed +7
-2
lines changed
x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 27
27
28
28
import static org .hamcrest .Matchers .equalTo ;
29
29
import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
30
+ import static org .hamcrest .Matchers .nullValue ;
30
31
import static org .mockito .Mockito .mock ;
31
32
import static org .mockito .Mockito .when ;
32
33
@@ -36,7 +37,7 @@ public class CCRFeatureSetTests extends ESTestCase {
36
37
private ClusterService clusterService ;
37
38
38
39
@ Before
39
- public void init () throws Exception {
40
+ public void init () {
40
41
licenseState = mock (XPackLicenseState .class );
41
42
clusterService = mock (ClusterService .class );
42
43
}
@@ -116,7 +117,11 @@ public void testUsageStats() throws Exception {
116
117
assertThat (ccrUsage .available (), equalTo (ccrFeatureSet .available ()));
117
118
118
119
assertThat (ccrUsage .getNumberOfFollowerIndices (), equalTo (numFollowerIndices ));
119
- assertThat (ccrUsage .getLastFollowTimeInMillis (), greaterThanOrEqualTo (0L ));
120
+ if (numFollowerIndices != 0 ) {
121
+ assertThat (ccrUsage .getLastFollowTimeInMillis (), greaterThanOrEqualTo (0L ));
122
+ } else {
123
+ assertThat (ccrUsage .getLastFollowTimeInMillis (), nullValue ());
124
+ }
120
125
assertThat (ccrUsage .getNumberOfAutoFollowPatterns (), equalTo (numAutoFollowPatterns ));
121
126
}
122
127
You can’t perform that action at this time.
0 commit comments