Skip to content

Commit 838650d

Browse files
committed
fix mock usage to prevent singleton mutation
1 parent 39309e2 commit 838650d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test-harness/tests/specs/integration/JWTSpec.cfc

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,10 +394,10 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
394394
then( "it should use the exp on the token for the storage timeout", function(){
395395
var originalTokenStorage = variables.jwtService.getTokenStorage();
396396
try {
397-
variables.jwtService.getTokenStorage().clearAll();
398397
var tokenStorageMock = prepareMock(
399-
getWirebox().getInstance( "CacheTokenStorage@cbsecurity" )
398+
new cbsecurity.models.jwt.storages.CacheTokenStorage()
400399
);
400+
getWirebox().autowire( tokenStorageMock );
401401
variables.jwtService.setTokenStorage( tokenStorageMock );
402402
tokenStorageMock.$( "set", tokenStorageMock );
403403
var expirationSeconds = 100;

0 commit comments

Comments
 (0)