Skip to content

Commit

Permalink
613: Fix-up the JWT expiration unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
halprin committed Oct 25, 2023
1 parent 54558a4 commit 6b691d8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,14 @@ class ReportStreamOrderSenderTest extends Specification {
def "ensure jwt that expires 15 seconds from now is valid"() {
given:
def mockAuthEngine = Mock(AuthEngine)
TestApplicationContext.register(AuthEngine, mockAuthEngine)

mockAuthEngine.getExpirationDate(_ as String) >> LocalDateTime.now().plus(20, ChronoUnit.SECONDS)
TestApplicationContext.register(OrderSender, ReportStreamOrderSender.getInstance())

TestApplicationContext.register(AuthEngine, mockAuthEngine)
TestApplicationContext.injectRegisteredImplementations()
ReportStreamOrderSender.getInstance().setRsTokenCache("our token from rs")

when:
def isValid = ReportStreamOrderSender.getInstance().isValidToken()
def isValid = ReportStreamOrderSender.getInstance().isValidToken("our token from rs")

then:
isValid
Expand Down

0 comments on commit 6b691d8

Please sign in to comment.