Skip to content

Bugfix: no stups token bean if not needed#176

Merged
ePaul merged 3 commits intomasterfrom
bugfix-no-stups-token-bean
Aug 22, 2023
Merged

Bugfix: no stups token bean if not needed#176
ePaul merged 3 commits intomasterfrom
bugfix-no-stups-token-bean

Conversation

@ePaul
Copy link
Copy Markdown
Member

@ePaul ePaul commented Aug 8, 2023

When the application already supplies a NakadiPublishingClient
or NakadiClient bean, we don't need our own authentication setup.

This was already meant to be skipped, but I guess we misunderstood
how nested configuration classes work – they don't inherit their
outer classes' conditions.

As an effect, even when one of these beans is already there, a new
StupsTokenComponent bean was created (and the build failed if that was
not possible e.g. due to missing configuration variables).

  • This adds a test which checks that the StupsTokenComponent bean is not created
    when we got the MockPublishingClient bean. (Fails if just running the first commit.)

  • We then make the creation of the StupsTokenComponent dependent on missing both beans.

    As an effect, when running the tests we don't get all the error messages about missing
    CREDENTIALS_DIR environment variables anymore.

  • As a bonus, we also add an AccessTokenProvider @MockBean to NakadiClientEncodingIT (which doesn't have a NakadiPublishingClient) to avoid getting the error messages about CREDENTIALS_DIR here.

@ePaul ePaul added bug auto-configuration everything about the auto-configuration features spring-boot-2 Issues/PRs which only apply to the Spring-Boot 2 versions (Releases 20.*+) labels Aug 8, 2023
@ePaul ePaul requested a review from fbrns as a code owner August 8, 2023 09:40
ePaul added 2 commits August 15, 2023 16:27
When the application already supplies a NakadiPublishingClient
or NakadiClient bean, we don't need our own authentication setup.

This was already meant to be skipped, but I guess we misunderstood
how nested configuration classes work – they don't inherit their
outer classes' conditions.
@ePaul ePaul force-pushed the bugfix-no-stups-token-bean branch from db124f4 to 3bbdf4d Compare August 15, 2023 14:28
@ePaul
Copy link
Copy Markdown
Member Author

ePaul commented Aug 15, 2023

👍

1 similar comment
@fbrns
Copy link
Copy Markdown
Member

fbrns commented Aug 22, 2023

👍

@ePaul ePaul merged commit 6046439 into master Aug 22, 2023
@ePaul ePaul deleted the bugfix-no-stups-token-bean branch August 22, 2023 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-configuration everything about the auto-configuration features bug spring-boot-2 Issues/PRs which only apply to the Spring-Boot 2 versions (Releases 20.*+)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants