Skip to content

Commit

Permalink
Fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakith-Rambukkanage committed Oct 13, 2023
1 parent 560ed84 commit 3ea5ec7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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";
Expand All @@ -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);
Expand Down

0 comments on commit 3ea5ec7

Please sign in to comment.