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
});
    }
    private void assertRegisterValidLicense(Settings baseSettings, License.LicenseType licenseType) throws IOException {
        tryRegisterLicense(baseSettings, licenseType, future -> assertThat(future.actionGet().status(), equalTo(LicensesStatus.VALID)));
    }
    private void assertRegisterDisallowedLicenseType(Settings baseSettings, License.LicenseType licenseType) throws IOException {
        tryRegisterLicense(baseSettings, licenseType, future -> {
            final IllegalArgumentException exception = expectThrows(IllegalArgumentException.class, future::actionGet);
            assertThat(
                exception,
                TestMatchers.throwableWithMessage(
                    "Registering [" + licenseType.getTypeName() + "] licenses is not allowed on " + "this cluster"
                )
            );
        });
    }
    private void tryRegisterLicense(
        Settings baseSettings,
        License.LicenseType licenseType,
        Consumer<PlainActionFuture<PutLicenseResponse>> assertion
    ) throws IOException {
        tryRegisterLicense(baseSettings, sign(buildLicense(licenseType, TimeValue.timeValueDays(randomLongBetween(1, 1000)))), assertion);
    }
    private void tryRegisterLicense(Settings baseSettings, License license, Consumer<PlainActionFuture<PutLicenseResponse>> assertion)
        throws IOException {
        final Settings settings = Settings.builder()
            .put(baseSettings)
            .put("path.home", createTempDir())
            .put(DISCOVERY_TYPE_SETTING.getKey(), SINGLE_NODE_DISCOVERY_TYPE) 
            .build();