mirror of
https://github.com/keycloak/keycloak.git
synced 2026-01-07 07:19:55 -06:00
Testsuite PoC - Allow inner classes for config to be non-public (#31656)
Signed-off-by: stianst <stianst@gmail.com>
This commit is contained in:
@@ -1,10 +1,14 @@
|
||||
package org.keycloak.test.framework.injection;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public class SupplierHelpers {
|
||||
|
||||
public static <T> T getInstance(Class<T> clazz) {
|
||||
try {
|
||||
return clazz.getDeclaredConstructor().newInstance();
|
||||
Constructor<T> declaredConstructor = clazz.getDeclaredConstructor();
|
||||
declaredConstructor.setAccessible(true);
|
||||
return declaredConstructor.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user