File tree 1 file changed +13
-9
lines changed
x-pack/plugin/core/src/test/java/org/elasticsearch/license
1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -35,15 +35,19 @@ public void init() throws Exception {
35
35
36
36
public void testLicenseOperationModeUpdate () throws Exception {
37
37
License .LicenseType type = randomFrom (License .LicenseType .values ());
38
- License license = License .builder ()
39
- .uid ("id" )
40
- .expiryDate (0 )
41
- .issueDate (0 )
42
- .issuedTo ("elasticsearch" )
43
- .issuer ("issuer" )
44
- .type (type )
45
- .maxNodes (1 )
46
- .build ();
38
+ final License .Builder licenseBuilder = License .builder ()
39
+ .uid ("id" )
40
+ .expiryDate (0 )
41
+ .issueDate (0 )
42
+ .issuedTo ("elasticsearch" )
43
+ .issuer ("issuer" )
44
+ .type (type );
45
+ if (type == License .LicenseType .ENTERPRISE ) {
46
+ licenseBuilder .maxResourceUnits (1 );
47
+ } else {
48
+ licenseBuilder .maxNodes (1 );
49
+ }
50
+ License license = licenseBuilder .build ();
47
51
48
52
assertThat (license .operationMode (), equalTo (License .OperationMode .resolve (type )));
49
53
OperationModeFileWatcherTests .writeMode ("gold" , licenseModeFile );
You can’t perform that action at this time.
0 commit comments