File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2727
2828import static org .hamcrest .Matchers .equalTo ;
2929import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
30+ import static org .hamcrest .Matchers .nullValue ;
3031import static org .mockito .Mockito .mock ;
3132import static org .mockito .Mockito .when ;
3233
@@ -36,7 +37,7 @@ public class CCRFeatureSetTests extends ESTestCase {
3637 private ClusterService clusterService ;
3738
3839 @ Before
39- public void init () throws Exception {
40+ public void init () {
4041 licenseState = mock (XPackLicenseState .class );
4142 clusterService = mock (ClusterService .class );
4243 }
@@ -116,7 +117,11 @@ public void testUsageStats() throws Exception {
116117 assertThat (ccrUsage .available (), equalTo (ccrFeatureSet .available ()));
117118
118119 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+ }
120125 assertThat (ccrUsage .getNumberOfAutoFollowPatterns (), equalTo (numAutoFollowPatterns ));
121126 }
122127
You can’t perform that action at this time.
0 commit comments