Skip to content

Commit

Permalink
set dummy RsaJsonWebKey in quarkus tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jcschaff committed Apr 20, 2024
1 parent 3e6c5a6 commit e80cbcd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
import io.quarkus.test.keycloak.client.KeycloakTestClient;
import jakarta.inject.Inject;
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.jose4j.jwk.RsaJsonWebKey;
import org.jose4j.lang.JoseException;
import org.junit.jupiter.api.*;
import org.vcell.auth.JWTUtils;
import org.vcell.restclient.ApiClient;
import org.vcell.restclient.ApiException;
import org.vcell.restclient.api.UsersResourceApi;
Expand Down Expand Up @@ -43,9 +46,11 @@ public class UsersApiTest {
private ApiClient bobAPIClient;

@BeforeEach
public void createClients(){
public void createClients() throws JoseException {
aliceAPIClient = TestEndpointUtils.createAuthenticatedAPIClient(keycloakClient, testPort, TestEndpointUtils.TestOIDCUsers.alice);
bobAPIClient = TestEndpointUtils.createAuthenticatedAPIClient(keycloakClient, testPort, TestEndpointUtils.TestOIDCUsers.bob);
RsaJsonWebKey rsaJsonWebKey = JWTUtils.createNewJsonWebKey("k1");
JWTUtils.setRsaJsonWebKey(rsaJsonWebKey);
}
@BeforeAll
public static void setupConfig(){
Expand Down
2 changes: 1 addition & 1 deletion vcell-server/src/main/java/org/vcell/auth/JWTUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class JWTUtils {
public static String VCELL_JWT_AUDIENCE = "VCellService";
public static String VCELL_JWT_ISSUER = "VCellService";

static void setRsaJsonWebKey(RsaJsonWebKey rsaJsonWebKey) {
public static void setRsaJsonWebKey(RsaJsonWebKey rsaJsonWebKey) {
JWTUtils.rsaJsonWebKey = rsaJsonWebKey;
}

Expand Down

0 comments on commit e80cbcd

Please sign in to comment.