-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support changing Clock to control time in testing with embedded server #581
Comments
Hi, is there any update on this. I think this is quite a blocker in testing. For example, we have a spring boot application. Now in integration tests, we change time of clock bean to a fixed time 10 years ago, for example. |
Hello, |
This issue is stale because it has been open for 60 days with no activity. |
Hei, nothing planned.. can have a look :) |
@xuan-dai-nguyen-db you should be able to override the issue time in the token by setting the time in the @kvokacka #668 lets you configure the system time with JSON config for the docker container. |
Amazing! Thanks @tommytroen! |
@tommytroen with this change, is it possible to set time after running the embedded server? Do I need to create a custom OAuth2TokenProvider in this case? If yes, do you have any suggestion for the implementation of custom OAuth2TokenProvider? |
Currently the library uses system clock to calculate time related fields when issue/validate token.
It would be nice if use-site could set the java.time.Clock instance to control timing behaviours of mock-oauth2-server in tests.
The text was updated successfully, but these errors were encountered: