Remove deprecated Humio's repository property

Closes gh-20808
pull/20830/head
Stephane Nicoll 5 years ago
parent 1f8ea54c80
commit 2815e6ee2d

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -22,7 +22,6 @@ import java.util.Map;
import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties; import org.springframework.boot.actuate.autoconfigure.metrics.export.properties.StepRegistryProperties;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.context.properties.DeprecatedConfigurationProperty;
/** /**
* {@link ConfigurationProperties @ConfigurationProperties} for configuring Humio metrics * {@link ConfigurationProperties @ConfigurationProperties} for configuring Humio metrics
@ -44,11 +43,6 @@ public class HumioProperties extends StepRegistryProperties {
*/ */
private Duration connectTimeout = Duration.ofSeconds(5); private Duration connectTimeout = Duration.ofSeconds(5);
/**
* Name of the repository to publish metrics to.
*/
private String repository = "";
/** /**
* Humio tags describing the data source in which metrics will be stored. Humio tags * Humio tags describing the data source in which metrics will be stored. Humio tags
* are a distinct concept from Micrometer's tags. Micrometer's tags are used to divide * are a distinct concept from Micrometer's tags. Micrometer's tags are used to divide
@ -80,17 +74,6 @@ public class HumioProperties extends StepRegistryProperties {
this.connectTimeout = connectTimeout; this.connectTimeout = connectTimeout;
} }
@Deprecated
@DeprecatedConfigurationProperty(reason = "No longer used as repository is resolved from the api token.")
public String getRepository() {
return this.repository;
}
@Deprecated
public void setRepository(String repository) {
this.repository = repository;
}
public Map<String, String> getTags() { public Map<String, String> getTags() {
return this.tags; return this.tags;
} }

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -43,12 +43,6 @@ class HumioPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<H
return get(HumioProperties::getUri, HumioConfig.super::uri); return get(HumioProperties::getUri, HumioConfig.super::uri);
} }
@Override
@Deprecated
public String repository() {
return get(HumioProperties::getRepository, HumioConfig.super::repository);
}
@Override @Override
public Map<String, String> tags() { public Map<String, String> tags() {
return get(HumioProperties::getTags, HumioConfig.super::tags); return get(HumioProperties::getTags, HumioConfig.super::tags);

@ -253,6 +253,12 @@
"name": "management.metrics.export.influx.consistency", "name": "management.metrics.export.influx.consistency",
"defaultValue": "one" "defaultValue": "one"
}, },
{
"name": "management.metrics.export.humio.repository",
"deprecation": {
"level": "error"
}
},
{ {
"name": "management.metrics.export.prometheus.enabled", "name": "management.metrics.export.prometheus.enabled",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -36,14 +36,6 @@ class HumioPropertiesConfigAdapterTests {
assertThat(new HumioPropertiesConfigAdapter(properties).apiToken()).isEqualTo("ABC123"); assertThat(new HumioPropertiesConfigAdapter(properties).apiToken()).isEqualTo("ABC123");
} }
@Test
@Deprecated
void whenPropertiesRepositoryIsSetAdapterRepositoryReturnsIt() {
HumioProperties properties = new HumioProperties();
properties.setRepository("test");
assertThat(new HumioPropertiesConfigAdapter(properties).repository()).isEqualTo("test");
}
@Test @Test
void whenPropertiesTagsIsSetAdapterTagsReturnsIt() { void whenPropertiesTagsIsSetAdapterTagsReturnsIt() {
HumioProperties properties = new HumioProperties(); HumioProperties properties = new HumioProperties();

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -31,13 +31,11 @@ import static org.assertj.core.api.Assertions.assertThat;
class HumioPropertiesTests extends StepRegistryPropertiesTests { class HumioPropertiesTests extends StepRegistryPropertiesTests {
@Test @Test
@SuppressWarnings("deprecation")
void defaultValuesAreConsistent() { void defaultValuesAreConsistent() {
HumioProperties properties = new HumioProperties(); HumioProperties properties = new HumioProperties();
HumioConfig config = (key) -> null; HumioConfig config = (key) -> null;
assertStepRegistryDefaultValues(properties, config); assertStepRegistryDefaultValues(properties, config);
assertThat(properties.getApiToken()).isEqualTo(config.apiToken()); assertThat(properties.getApiToken()).isEqualTo(config.apiToken());
assertThat(properties.getRepository()).isEqualTo(config.repository());
assertThat(properties.getTags()).isEmpty(); assertThat(properties.getTags()).isEmpty();
assertThat(config.tags()).isNull(); assertThat(config.tags()).isNull();
assertThat(properties.getUri()).isEqualTo(config.uri()); assertThat(properties.getUri()).isEqualTo(config.uri());

Loading…
Cancel
Save