Skip to content

Commit

Permalink
fix mock usage to prevent singleton mutation
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Jan 10, 2025
1 parent 39309e2 commit 838650d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test-harness/tests/specs/integration/JWTSpec.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
then( "it should use the exp on the token for the storage timeout", function(){
var originalTokenStorage = variables.jwtService.getTokenStorage();
try {
variables.jwtService.getTokenStorage().clearAll();
var tokenStorageMock = prepareMock(
getWirebox().getInstance( "CacheTokenStorage@cbsecurity" )
new cbsecurity.models.jwt.storages.CacheTokenStorage()
);
getWirebox().autowire( tokenStorageMock );
variables.jwtService.setTokenStorage( tokenStorageMock );
tokenStorageMock.$( "set", tokenStorageMock );
var expirationSeconds = 100;
Expand Down

0 comments on commit 838650d

Please sign in to comment.