From 3ea5ec7031af922649627897e1aa1a0f25d2b515 Mon Sep 17 00:00:00 2001 From: Lakith Date: Fri, 13 Oct 2023 09:51:20 +0530 Subject: [PATCH] Fix test failure --- .../gateway/handlers/security/jwt/JWTValidatorTest.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/test/java/org/wso2/carbon/apimgt/gateway/handlers/security/jwt/JWTValidatorTest.java b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/test/java/org/wso2/carbon/apimgt/gateway/handlers/security/jwt/JWTValidatorTest.java index 89cc365ee31d..e2e152226719 100644 --- a/components/apimgt/org.wso2.carbon.apimgt.gateway/src/test/java/org/wso2/carbon/apimgt/gateway/handlers/security/jwt/JWTValidatorTest.java +++ b/components/apimgt/org.wso2.carbon.apimgt.gateway/src/test/java/org/wso2/carbon/apimgt/gateway/handlers/security/jwt/JWTValidatorTest.java @@ -40,6 +40,7 @@ import org.wso2.carbon.apimgt.gateway.handlers.security.APISecurityException; import org.wso2.carbon.apimgt.gateway.handlers.security.AuthenticationContext; import org.wso2.carbon.apimgt.gateway.internal.ServiceReferenceHolder; +import org.wso2.carbon.apimgt.gateway.jwt.InternalRevokedJWTDataHolder; import org.wso2.carbon.apimgt.gateway.utils.GatewayUtils; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerConfiguration; @@ -65,7 +66,7 @@ @RunWith(PowerMockRunner.class) @PrepareForTest({JWTValidator.class, GatewayUtils.class, MultitenantUtils.class, PrivilegedCarbonContext.class, - ServiceReferenceHolder.class, CertificateMgtUtils.class}) + ServiceReferenceHolder.class, CertificateMgtUtils.class, InternalRevokedJWTDataHolder.class}) public class JWTValidatorTest { private static String PASSWORD = "wso2carbon"; @@ -79,6 +80,9 @@ public void setup() { PowerMockito.mockStatic(MultitenantUtils.class); PowerMockito.mockStatic(PrivilegedCarbonContext.class); PowerMockito.mockStatic(ServiceReferenceHolder.class); + PowerMockito.mockStatic(InternalRevokedJWTDataHolder.class); + PowerMockito.when(InternalRevokedJWTDataHolder.getInstance()) + .thenReturn(PowerMockito.mock(InternalRevokedJWTDataHolder.class)); privilegedCarbonContext = Mockito.mock(PrivilegedCarbonContext.class); serviceReferenceHolder = Mockito.mock(ServiceReferenceHolder.class); PowerMockito.when(PrivilegedCarbonContext.getThreadLocalCarbonContext()).thenReturn(privilegedCarbonContext);