Skip to content

Re-enable Spring Pulsar interceptor tests #39912

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

Closed

Conversation

onobc
Copy link
Contributor

@onobc onobc commented Mar 12, 2024

The PulsarTemplate recently replaced its list of ProducerInterceptors with a list of ProducerBuilderCustomizers that customize the builder by adding each interceptor to the builder. The PulsarAutoConfigurationTests previosuly relied on the previous field. This commit adjusts the tests to instead use the Customizers testing utility to verify the interceptors.

cc: @wilkinsona

The PulsarTemplate recently replaced its list of ProducerInterceptors
with a list of ProducerBuilderCustomizers that customize the builder by
adding each interceptor to the builder. The PulsarAutoConfigurationTests
previosuly relied on the previous field. This commit adjusts the tests
to instead use the Customizers testing utility to verify the
interceptors.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 12, 2024
.contains(interceptor));
.run((context) -> {
PulsarTemplate<?> pulsarTemplate = context.getBean(PulsarTemplate.class);
Customizers<ProducerBuilderCustomizer<T>, ProducerBuilder<T>> customizers = Customizers
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@philwebb added this Customizers testing utility to ease the burden of verifying customizers. Basically because they are lambdas we have to execute them and see if they "customized" what we expected them to customizer (and in order). In this case, we know our producer builder customizers are going to call ProducerBuilder.intercept with the specified interceptor.

@mhalbritter mhalbritter added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 13, 2024
@mhalbritter mhalbritter added this to the 3.2.x milestone Mar 13, 2024
@mhalbritter mhalbritter self-assigned this Mar 13, 2024
@mhalbritter mhalbritter modified the milestones: 3.2.x, 3.3.x Mar 13, 2024
mhalbritter pushed a commit that referenced this pull request Mar 13, 2024
The PulsarTemplate recently replaced its list of ProducerInterceptors
with a list of ProducerBuilderCustomizers that customize the builder by
adding each interceptor to the builder. The PulsarAutoConfigurationTests
previosuly relied on the previous field. This commit adjusts the tests
to instead use the Customizers testing utility to verify the
interceptors.

See gh-39912
@mhalbritter
Copy link
Contributor

Thank you!

@mhalbritter mhalbritter modified the milestones: 3.3.x, 3.3.0-M3 Mar 13, 2024
onobc added a commit to onobc/spring-boot that referenced this pull request Mar 15, 2024
The PulsarTemplate recently replaced its list of ProducerInterceptors
with a list of ProducerBuilderCustomizers that customize the builder by
adding each interceptor to the builder. The PulsarAutoConfigurationTests
previosuly relied on the previous field. This commit adjusts the tests
to instead use the Customizers testing utility to verify the
interceptors.

See spring-projectsgh-39912

(cherry picked from commit 9c054a0)
@onobc onobc deleted the cbono-fix-pulsar-interceptor-tests branch May 28, 2024 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants