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

Allow Webhook class instance to be configured with java.time.Clock #1680

Open
lnhrdt opened this issue Nov 3, 2023 · 1 comment
Open

Allow Webhook class instance to be configured with java.time.Clock #1680

lnhrdt opened this issue Nov 3, 2023 · 1 comment

Comments

@lnhrdt
Copy link

lnhrdt commented Nov 3, 2023

Is your feature request related to a problem? Please describe.

In our application every piece of code that references the current time uses a instance of java.time.Clock. This technique has allowed us to create a suite of reliable tests (aka not flakey tests) in a consistent way across our codebase.

com.stripe.net.Webhook makes a direct reference to java.lang.System.currentTimeMillis() which prevents us from using this technique when testing our Stripe webhook integration. I wish it were possible to create a configured instance of Webhook (perhaps in a similar way to the new StripeClient builder) passing in an instance of Clock so that we could test our Stripe webhook integration in the same way as the rest of our application.

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional context

No response

@richardm-stripe
Copy link
Contributor

Hello @lnhrdt, thanks for the feedback. This seems like a reasonable request to me. I'm marking this as future as we won't be able to prioritize this right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants