For `POST _license/start_basic` the API, the system decides whether a new basic license should be generated using the following logic:

https://github.com/elastic/elasticsearch/blob/3c15e4ebb1ae045d5cc690a0fd1e2f3c73173d39/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java#L101-L106

However, when building the response, the logic only takes account into old license type without checking maxNodes and expiryDate:

https://github.com/elastic/elasticsearch/blob/3c15e4ebb1ae045d5cc690a0fd1e2f3c73173d39/x-pack/plugin/core/src/main/java/org/elasticsearch/license/StartBasicClusterTask.java#L64-L65

This means it is possible that client gets an error response of 
```json
{
  "acknowledged": true,
  "basic_was_started": false,
  "error_message": "Operation failed: Current license is basic."
}
```
while the license is actually generated successfully at the backend. 

See also: https://github.com/elastic/elasticsearch/pull/85993#discussion_r859356499
x-pack/plugin/core/src/test/java/org/elasticsearch/license/LicenseServiceTests.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */
package org.elasticsearch.license;
import org.elasticsearch.action.support.PlainActionFuture;
import org.elasticsearch.cluster.AckedClusterStateUpdateTask;
import org.elasticsearch.cluster.ClusterState;
import org.elasticsearch.cluster.ClusterStateUpdateTask;
import org.elasticsearch.cluster.metadata.Metadata;
import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.bytes.BytesReference;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.env.Environment;
import org.elasticsearch.env.TestEnvironment;
import org.elasticsearch.license.licensor.LicenseSigner;
import org.elasticsearch.protocol.xpack.license.LicensesStatus;
import org.elasticsearch.protocol.xpack.license.PutLicenseResponse;
import org.elasticsearch.test.ESTestCase;
import org.elasticsearch.test.TestMatchers;
import org.elasticsearch.threadpool.ThreadPool;
import org.elasticsearch.watcher.ResourceWatcherService;
import org.elasticsearch.xcontent.ToXContent;
import org.elasticsearch.xcontent.XContentBuilder;
import org.elasticsearch.xcontent.XContentFactory;
import org.elasticsearch.xcontent.XContentType;
import org.hamcrest.Matchers;