diff --git a/test-poc/framework/src/main/java/org/keycloak/test/framework/injection/SupplierHelpers.java b/test-poc/framework/src/main/java/org/keycloak/test/framework/injection/SupplierHelpers.java index 62c9909126..46402f6709 100644 --- a/test-poc/framework/src/main/java/org/keycloak/test/framework/injection/SupplierHelpers.java +++ b/test-poc/framework/src/main/java/org/keycloak/test/framework/injection/SupplierHelpers.java @@ -1,10 +1,14 @@ package org.keycloak.test.framework.injection; +import java.lang.reflect.Constructor; + public class SupplierHelpers { public static T getInstance(Class clazz) { try { - return clazz.getDeclaredConstructor().newInstance(); + Constructor declaredConstructor = clazz.getDeclaredConstructor(); + declaredConstructor.setAccessible(true); + return declaredConstructor.newInstance(); } catch (Exception e) { throw new RuntimeException(e); }