diff --git a/elasticsearch/x-pack/license-plugin/src/test/resources/rest-api-spec/test/license/20_put_license.yaml b/elasticsearch/x-pack/license-plugin/src/test/resources/rest-api-spec/test/license/20_put_license.yaml index 79698b72c58..a5873dba99f 100644 --- a/elasticsearch/x-pack/license-plugin/src/test/resources/rest-api-spec/test/license/20_put_license.yaml +++ b/elasticsearch/x-pack/license-plugin/src/test/resources/rest-api-spec/test/license/20_put_license.yaml @@ -74,5 +74,5 @@ teardown: - match: { acknowledged: true } - do: - license.get: {} + xpack.license.get: {} catch: missing diff --git a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java index ddcd5479716..0a107f7705a 100644 --- a/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java +++ b/elasticsearch/x-pack/src/test/java/org/elasticsearch/xpack/test/rest/XPackRestTestCase.java @@ -8,33 +8,15 @@ package org.elasticsearch.xpack.test.rest; import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; -import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.common.util.concurrent.ThreadContext; -import org.elasticsearch.common.xcontent.ToXContent; -import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentFactory; -import org.elasticsearch.common.xcontent.XContentParser; -import org.elasticsearch.license.plugin.TestUtils; import org.elasticsearch.test.rest.ESRestTestCase; import org.elasticsearch.test.rest.RestTestCandidate; -import org.elasticsearch.test.rest.client.RestTestResponse; import org.elasticsearch.test.rest.parser.RestTestParseException; -import org.elasticsearch.xpack.security.authc.esnative.ReservedRealm; import org.elasticsearch.xpack.security.authc.support.SecuredString; -import org.elasticsearch.xpack.security.authz.store.ReservedRolesStore; -import org.junit.After; -import org.junit.Before; import java.io.IOException; -import java.util.List; -import java.util.Map; -import static java.util.Collections.emptyList; -import static java.util.Collections.emptyMap; -import static java.util.Collections.singletonList; -import static java.util.Collections.singletonMap; import static org.elasticsearch.xpack.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue; public abstract class XPackRestTestCase extends ESRestTestCase { @@ -50,19 +32,6 @@ public abstract class XPackRestTestCase extends ESRestTestCase { return ESRestTestCase.createParameters(0, 1); } - @Before - public void installLicense() throws Exception { - final XContentBuilder builder = XContentFactory.jsonBuilder(); - TestUtils.generateSignedLicense("trial", TimeValue.timeValueHours(2)).toXContent(builder, ToXContent.EMPTY_PARAMS); - final BytesReference bytes = builder.bytes(); - try (XContentParser parser = XContentFactory.xContent(bytes).createParser(bytes)) { - final List> bodies = singletonList(singletonMap("license", - parser.map())); - getAdminExecutionContext().callApi("license.post", singletonMap("acknowledge", "true"), - bodies, singletonMap("Authorization", BASIC_AUTH_VALUE)); - } - } - @Override protected Settings restClientSettings() { return Settings.builder() diff --git a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/15_basic.yaml b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/15_basic.yaml index a09ba56daad..b65872fee18 100644 --- a/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/15_basic.yaml +++ b/elasticsearch/x-pack/src/test/resources/rest-api-spec/test/xpack/15_basic.yaml @@ -7,7 +7,7 @@ wait_for_status: yellow - do: - license.delete: {} + xpack.license.delete: {} - match: { acknowledged: true } # we don't have a license now @@ -30,7 +30,7 @@ # - is_false: features.monitoring.available TODO fix once licensing is fixed - do: - license.post: + xpack.license.post: body: > { "license": { @@ -49,7 +49,7 @@ - match: { license_status: "valid" } - do: - license.get: {} + xpack.license.get: {} - match: { license.uid: "893361dc-9749-4997-93cb-802e3dofh7aa" } - match: { license.type: "internal" } - match: { license.status: "active" }