10
10
import org .elasticsearch .client .Client ;
11
11
import org .elasticsearch .cluster .service .ClusterService ;
12
12
import org .elasticsearch .common .settings .Settings ;
13
- import org .elasticsearch .core .TimeValue ;
14
13
import org .elasticsearch .common .util .concurrent .ThreadContext ;
14
+ import org .elasticsearch .core .TimeValue ;
15
15
import org .elasticsearch .license .XPackLicenseState ;
16
16
import org .elasticsearch .xpack .core .XPackSettings ;
17
17
import org .elasticsearch .xpack .core .ccr .AutoFollowStats ;
18
+ import org .elasticsearch .xpack .core .ccr .CcrConstants ;
18
19
import org .elasticsearch .xpack .core .ccr .ShardFollowNodeTaskStatus ;
19
20
import org .elasticsearch .xpack .core .ccr .action .FollowStatsAction ;
20
21
import org .elasticsearch .xpack .core .ccr .action .CcrStatsAction ;
@@ -44,7 +45,7 @@ public void testShouldCollectReturnsFalseIfNotMaster() {
44
45
// regardless of CCR being enabled
45
46
final Settings settings = randomFrom (ccrEnabledSettings (), ccrDisabledSettings ());
46
47
47
- when (licenseState .checkFeature ( XPackLicenseState . Feature . CCR )).thenReturn (randomBoolean ());
48
+ when (licenseState .isAllowed ( CcrConstants . CCR_FEATURE )).thenReturn (randomBoolean ());
48
49
// this controls the blockage
49
50
final boolean isElectedMaster = false ;
50
51
@@ -57,7 +58,7 @@ public void testShouldCollectReturnsFalseIfCCRIsDisabled() {
57
58
// this is controls the blockage
58
59
final Settings settings = ccrDisabledSettings ();
59
60
60
- when (licenseState .checkFeature ( XPackLicenseState . Feature . CCR )).thenReturn (randomBoolean ());
61
+ when (licenseState .isAllowed ( CcrConstants . CCR_FEATURE )).thenReturn (randomBoolean ());
61
62
62
63
final boolean isElectedMaster = randomBoolean ();
63
64
whenLocalNodeElectedMaster (isElectedMaster );
@@ -71,7 +72,7 @@ public void testShouldCollectReturnsFalseIfCCRIsNotAllowed() {
71
72
final Settings settings = randomFrom (ccrEnabledSettings (), ccrDisabledSettings ());
72
73
73
74
// this is controls the blockage
74
- when (licenseState .checkFeature ( XPackLicenseState . Feature . CCR )).thenReturn (false );
75
+ when (licenseState .isAllowed ( CcrConstants . CCR_FEATURE )).thenReturn (false );
75
76
final boolean isElectedMaster = randomBoolean ();
76
77
whenLocalNodeElectedMaster (isElectedMaster );
77
78
@@ -83,7 +84,7 @@ public void testShouldCollectReturnsFalseIfCCRIsNotAllowed() {
83
84
public void testShouldCollectReturnsTrue () {
84
85
final Settings settings = ccrEnabledSettings ();
85
86
86
- when (licenseState .checkFeature ( XPackLicenseState . Feature . CCR )).thenReturn (true );
87
+ when (licenseState .isAllowed ( CcrConstants . CCR_FEATURE )).thenReturn (true );
87
88
final boolean isElectedMaster = true ;
88
89
89
90
final StatsCollector collector = createCollector (settings , clusterService , licenseState , client );
0 commit comments