Skip to content

HealthEndpointAutoConfigurationTests should not rely on CloudFoundry #45721

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
snicoll opened this issue May 29, 2025 · 1 comment
Closed

HealthEndpointAutoConfigurationTests should not rely on CloudFoundry #45721

snicoll opened this issue May 29, 2025 · 1 comment
Assignees
Labels
type: task A general task
Milestone

Comments

@snicoll
Copy link
Member

snicoll commented May 29, 2025

We have a few tests that rely on the behavior of a EndpointExposureOutcomeContributor contribution. We do have one for CloudFoundry so we're reusing that behavior.

However, this leads to a few tests to expose cloudfoundry concerns where they shouldn't, really.

@snicoll snicoll added this to the 3.4.x milestone May 29, 2025
@snicoll snicoll added the type: task A general task label May 29, 2025
kwondh5217 added a commit to kwondh5217/spring-boot that referenced this issue May 31, 2025
This avoids relying on Cloud Foundry exposure logic in
HealthEndpointAutoConfigurationTests.

See spring-projectsgh-45721

Signed-off-by: Daeho Kwon <[email protected]>
@philwebb philwebb added the status: pending-design-work Needs design work before any code can be developed label May 31, 2025
@nosan
Copy link
Contributor

nosan commented Jun 1, 2025

I've prepared two branches for this issue:

The first one is pretty straightforward. It is based on CustomEndpointExposureOutcomeContributor, which is registered via test/resources/META-INF/spring.factories.


The second one also uses CustomEndpointExposureOutcomeContributor, but it is registered with @WithResource. However, it requires additional changes to OnAvailableEndpointCondition, such as passing ConditionContext.getClassLoader() as a parameter to SpringFactoriesLoader.forDefaultResourceLocation().

@wilkinsona wilkinsona self-assigned this Jun 6, 2025
@wilkinsona wilkinsona modified the milestones: 3.4.x, 3.4.7 Jun 6, 2025
@wilkinsona wilkinsona removed the status: pending-design-work Needs design work before any code can be developed label Jun 6, 2025
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

No branches or pull requests

4 participants