Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 authored and tharindu1st committed Oct 31, 2023
1 parent d9066ec commit b4a293c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,10 @@ public static Set<String> getRevokedTokens() {
return revokedTokensStatic;
}

public static void setRevokedTokens(Set<String>revokedTokensSet) {
revokedTokensStatic = revokedTokensSet;
}

private static SSLSocketFactory createSslSocketFactory(String redisCaCertPath) throws EnforcerException {
try {
KeyStore trustStore = TLSUtils.getDefaultCertTrustStore();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,15 @@
import com.google.common.cache.LoadingCache;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.UUID;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.mockito.MockedStatic;
import org.mockito.Mockito;
Expand All @@ -52,10 +54,16 @@
import org.wso2.apk.enforcer.security.KeyValidator;
import org.wso2.apk.enforcer.security.jwt.JWTAuthenticator;
import org.wso2.apk.enforcer.security.jwt.validator.JWTValidator;
import org.wso2.apk.enforcer.server.RevokedTokenRedisClient;
import org.wso2.apk.enforcer.subscription.SubscriptionDataStoreImpl;

public class JWTValidatorTest {

@Before
public void setup() {
RevokedTokenRedisClient.setRevokedTokens(new HashSet<>());
}

@Test
public void testJWTValidator() throws APISecurityException, EnforcerException {
String organization = "org1";
Expand Down

0 comments on commit b4a293c

Please sign in to comment.