Skip to content

Commit

Permalink
Add integration tests for Elasticsearch 8 (#3037)
Browse files Browse the repository at this point in the history
This commit also updates the existing integration tests to use Elasticsearch 7.17.0.
  • Loading branch information
izeye authored Feb 22, 2022
1 parent 31488cc commit 259923c
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@
import java.util.Base64;

/**
* Test Elasticsearch backend with API key authentication.
* Base class for testing Elasticsearch backend with API key authentication.
*
* @author Tommy Ludwig
* @author Johnny Lim
*/
class ElasticsearchApiKeyIntegrationTest extends ElasticsearchMeterRegistryElasticsearch7IntegrationTest {
abstract class AbstractElasticsearchApiKeyIntegrationTest extends AbstractElasticsearchMeterRegistryIntegrationTest {

@Override
protected ElasticConfig getConfig() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
@Tag("docker")
abstract class AbstractElasticsearchMeterRegistryIntegrationTest {

protected static final String VERSION_7 = "7.17.0";
protected static final String VERSION_8 = "8.0.0";

protected static final String USER = "elastic";
protected static final String PASSWORD = "changeme";

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2022 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micrometer.elastic;

/**
* Integration tests with API key authentication for Elasticsearch 7.
*
* @author Johnny Lim
*/
class Elasticsearch7ApiKeyIntegrationTest extends AbstractElasticsearchApiKeyIntegrationTest {

@Override
protected String getVersion() {
return VERSION_7;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright 2022 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micrometer.elastic;

/**
* Integration tests with API key authentication for Elasticsearch 8.
*
* @author Johnny Lim
*/
class Elasticsearch8ApiKeyIntegrationTest extends AbstractElasticsearchApiKeyIntegrationTest {

@Override
protected String getVersion() {
return VERSION_8;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class ElasticsearchMeterRegistryElasticsearch7IntegrationTest

@Override
protected String getVersion() {
return "7.16.3";
return VERSION_7;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright 2022 VMware, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.micrometer.elastic;

/**
* Integration tests on {@link ElasticMeterRegistry} for Elasticsearch 8.
*
* @author Johnny Lim
*/
class ElasticsearchMeterRegistryElasticsearch8IntegrationTest
extends AbstractElasticsearchMeterRegistryIntegrationTest {

@Override
protected String getVersion() {
return VERSION_8;
}

}

0 comments on commit 259923c

Please sign in to comment.