Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify 'observation-enabled' property defaults #39276

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ public static class Listener {
* Whether to record observations for when the Observations API is available and
* the client supports it.
*/
private boolean observationEnabled = true;
private boolean observationEnabled;

public SchemaType getSchemaType() {
return this.schemaType;
Expand Down Expand Up @@ -856,7 +856,7 @@ public static class Template {
/**
* Whether to record observations for when the Observations API is available.
*/
private boolean observationsEnabled = true;
private boolean observationsEnabled;

public boolean isObservationsEnabled() {
return this.observationsEnabled;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void whenHasUseDefinedProducerInterceptorsInjectsBeansInCorrectOrder() {
@Test
void whenNoPropertiesEnablesObservation() {
this.contextRunner.run((context) -> assertThat(context).getBean(PulsarTemplate.class)
.hasFieldOrPropertyWithValue("observationEnabled", true));
.hasFieldOrPropertyWithValue("observationEnabled", false));
}

@Test
Expand Down Expand Up @@ -451,7 +451,7 @@ void whenHasCustomProperties() {
void whenNoPropertiesEnablesObservation() {
this.contextRunner
.run((context) -> assertThat(context).getBean(ConcurrentPulsarListenerContainerFactory.class)
.hasFieldOrPropertyWithValue("containerProperties.observationEnabled", true));
.hasFieldOrPropertyWithValue("containerProperties.observationEnabled", false));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,12 @@ void customizeContainerProperties() {
PulsarProperties properties = new PulsarProperties();
properties.getConsumer().getSubscription().setType(SubscriptionType.Shared);
properties.getListener().setSchemaType(SchemaType.AVRO);
properties.getListener().setObservationEnabled(false);
properties.getListener().setObservationEnabled(true);
PulsarContainerProperties containerProperties = new PulsarContainerProperties("my-topic-pattern");
new PulsarPropertiesMapper(properties).customizeContainerProperties(containerProperties);
assertThat(containerProperties.getSubscriptionType()).isEqualTo(SubscriptionType.Shared);
assertThat(containerProperties.getSchemaType()).isEqualTo(SchemaType.AVRO);
assertThat(containerProperties.isObservationEnabled()).isFalse();
assertThat(containerProperties.isObservationEnabled()).isTrue();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,10 @@ class ListenerProperties {
void bind() {
Map<String, String> map = new HashMap<>();
map.put("spring.pulsar.listener.schema-type", "avro");
map.put("spring.pulsar.listener.observation-enabled", "false");
map.put("spring.pulsar.listener.observation-enabled", "true");
PulsarProperties.Listener properties = bindPropeties(map).getListener();
assertThat(properties.getSchemaType()).isEqualTo(SchemaType.AVRO);
assertThat(properties.isObservationEnabled()).isFalse();
assertThat(properties.isObservationEnabled()).isTrue();
}

}
Expand Down Expand Up @@ -389,9 +389,9 @@ class TemplateProperties {
@Test
void bind() {
Map<String, String> map = new HashMap<>();
map.put("spring.pulsar.template.observations-enabled", "false");
map.put("spring.pulsar.template.observations-enabled", "true");
PulsarProperties.Template properties = bindPropeties(map).getTemplate();
assertThat(properties.isObservationsEnabled()).isFalse();
assertThat(properties.isObservationsEnabled()).isTrue();
}

}
Expand Down