Skip to content

Webhook test and Testcontainers networking#40

Merged
oleg-nenashev merged 1 commit into
wiremock:mainfrom
bitxon:feature/webhook-callback
May 24, 2023
Merged

Webhook test and Testcontainers networking#40
oleg-nenashev merged 1 commit into
wiremock:mainfrom
bitxon:feature/webhook-callback

Conversation

@bitxon
Copy link
Copy Markdown
Contributor

@bitxon bitxon commented May 18, 2023

Description

When we work with Webhook callbacks, Testcontainers(Docker) brings additional complexity related to networking, because wiremock that inside docker needs to make request to host machine. This requires additional configuration

That is why i decided to add Tests that verify it and could be used as an example in documentation (in future)

Links

https://www.testcontainers.org/features/networking/

References

N/A

Submitter checklist

  • The PR request is well described and justified, including the body and the references
  • The PR title represents the desired changelog entry
  • The repository's code style is followed (see the contributing guide)
  • Test coverage that demonstrates that the change works as expected
  • For new features, there's necessary documentation in this pull request or in a subsequent PR to wiremock.org

@bitxon bitxon requested a review from oleg-nenashev as a code owner May 18, 2023 12:57
@bitxon bitxon force-pushed the feature/webhook-callback branch from 9b6d861 to 152f442 Compare May 18, 2023 21:38
Copy link
Copy Markdown
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Fine with me though I would have just used two WireMock Rule instances, It might be reasonable to not do so to avoid some false positive correlation, but could reduce the code size considerably

public static final String APPLICATION_PATH = "/application/callback-receiver";


public TestHttpServer applicationServer = TestHttpServer.newInstance();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could be another WireMock instance though

Copy link
Copy Markdown
Contributor Author

@bitxon bitxon May 23, 2023

Choose a reason for hiding this comment

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

Let me play with that to see witch approach looks better (Wiremock vs Custom Server)

@oleg-nenashev oleg-nenashev added the chore Maintenance label May 23, 2023
@oleg-nenashev
Copy link
Copy Markdown
Member

@bitxon I will merge this one for now, we can always improve on the top of it. And thank you!

@oleg-nenashev oleg-nenashev merged commit 57bb808 into wiremock:main May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants