|
@@ -150,7 +150,11 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
final PutLifecycleAction.Request putRequest = (PutLifecycleAction.Request) request;
|
|
|
assertThat(
|
|
|
putRequest.getPolicy().getName(),
|
|
|
- anyOf(equalTo(StackTemplateRegistry.LOGS_ILM_POLICY_NAME), equalTo(StackTemplateRegistry.METRICS_ILM_POLICY_NAME))
|
|
|
+ anyOf(
|
|
|
+ equalTo(StackTemplateRegistry.LOGS_ILM_POLICY_NAME),
|
|
|
+ equalTo(StackTemplateRegistry.METRICS_ILM_POLICY_NAME),
|
|
|
+ equalTo(StackTemplateRegistry.SYNTHETICS_ILM_POLICY_NAME)
|
|
|
+ )
|
|
|
);
|
|
|
assertNotNull(listener);
|
|
|
return new PutLifecycleAction.Response(true);
|
|
@@ -168,7 +172,7 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
|
|
|
ClusterChangedEvent event = createClusterChangedEvent(Collections.emptyMap(), nodes);
|
|
|
registry.clusterChanged(event);
|
|
|
- assertBusy(() -> assertThat(calledTimes.get(), equalTo(2)));
|
|
|
+ assertBusy(() -> assertThat(calledTimes.get(), equalTo(3)));
|
|
|
}
|
|
|
|
|
|
public void testPolicyAlreadyExists() {
|
|
@@ -180,7 +184,7 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
.stream()
|
|
|
.map(policyConfig -> policyConfig.load(xContentRegistry))
|
|
|
.collect(Collectors.toList());
|
|
|
- assertThat(policies, hasSize(2));
|
|
|
+ assertThat(policies, hasSize(3));
|
|
|
policies.forEach(p -> policyMap.put(p.getName(), p));
|
|
|
|
|
|
client.setVerifier((action, request, listener) -> {
|
|
@@ -209,7 +213,7 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
.stream()
|
|
|
.map(policyConfig -> policyConfig.load(xContentRegistry))
|
|
|
.collect(Collectors.toList());
|
|
|
- assertThat(policies, hasSize(2));
|
|
|
+ assertThat(policies, hasSize(3));
|
|
|
policies.forEach(p -> policyMap.put(p.getName(), p));
|
|
|
|
|
|
client.setVerifier((action, request, listener) -> {
|
|
@@ -276,6 +280,8 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
versions.put(StackTemplateRegistry.LOGS_MAPPINGS_COMPONENT_TEMPLATE_NAME, StackTemplateRegistry.REGISTRY_VERSION);
|
|
|
versions.put(StackTemplateRegistry.METRICS_SETTINGS_COMPONENT_TEMPLATE_NAME, StackTemplateRegistry.REGISTRY_VERSION);
|
|
|
versions.put(StackTemplateRegistry.METRICS_MAPPINGS_COMPONENT_TEMPLATE_NAME, StackTemplateRegistry.REGISTRY_VERSION);
|
|
|
+ versions.put(StackTemplateRegistry.SYNTHETICS_SETTINGS_COMPONENT_TEMPLATE_NAME, StackTemplateRegistry.REGISTRY_VERSION);
|
|
|
+ versions.put(StackTemplateRegistry.SYNTHETICS_MAPPINGS_COMPONENT_TEMPLATE_NAME, StackTemplateRegistry.REGISTRY_VERSION);
|
|
|
ClusterChangedEvent sameVersionEvent = createClusterChangedEvent(versions, nodes);
|
|
|
client.setVerifier((action, request, listener) -> {
|
|
|
if (action instanceof PutComponentTemplateAction) {
|
|
@@ -311,6 +317,14 @@ public class StackTemplateRegistryTests extends ESTestCase {
|
|
|
StackTemplateRegistry.METRICS_MAPPINGS_COMPONENT_TEMPLATE_NAME,
|
|
|
StackTemplateRegistry.REGISTRY_VERSION + randomIntBetween(1, 1000)
|
|
|
);
|
|
|
+ versions.put(
|
|
|
+ StackTemplateRegistry.SYNTHETICS_SETTINGS_COMPONENT_TEMPLATE_NAME,
|
|
|
+ StackTemplateRegistry.REGISTRY_VERSION + randomIntBetween(1, 1000)
|
|
|
+ );
|
|
|
+ versions.put(
|
|
|
+ StackTemplateRegistry.SYNTHETICS_MAPPINGS_COMPONENT_TEMPLATE_NAME,
|
|
|
+ StackTemplateRegistry.REGISTRY_VERSION + randomIntBetween(1, 1000)
|
|
|
+ );
|
|
|
ClusterChangedEvent higherVersionEvent = createClusterChangedEvent(versions, nodes);
|
|
|
registry.clusterChanged(higherVersionEvent);
|
|
|
}
|