diff --git a/src/test/java/org/springframework/data/redis/test/extension/JedisExtension.java b/src/test/java/org/springframework/data/redis/test/extension/JedisExtension.java
index d438926b3d..e5440dfdb6 100644
--- a/src/test/java/org/springframework/data/redis/test/extension/JedisExtension.java
+++ b/src/test/java/org/springframework/data/redis/test/extension/JedisExtension.java
@@ -45,7 +45,7 @@
* callbacks. The following resource types are supported by this extension:
*
*
{@link Jedis} (singleton)
- *
{@link JediCluster} (singleton)
+ *
{@link JedisCluster} (singleton)
*
*
*
@@ -66,6 +66,7 @@
* is managed by this extension.
*
* @author Mark Paluch
+ * @author John Blum
* @see ParameterResolver
* @see BeforeEachCallback
*/
@@ -86,18 +87,14 @@ public boolean supportsParameter(ParameterContext parameterContext, ExtensionCon
}
/**
- * Attempt to resolve the {@code requestedResourceType}.
- *
- * @param extensionContext
- * @param requestedResourceType
- * @param
- * @return
+ * Attempt to resolve the {@link Class requestedResourceType}.
*/
+ @SuppressWarnings("unchecked")
public T resolve(ExtensionContext extensionContext, Class requestedResourceType) {
ExtensionContext.Store store = getStore(extensionContext);
- return (T) store.getOrComputeIfAbsent(requestedResourceType, it -> findSupplier(requestedResourceType).get());
+ return (T) store.getOrComputeIfAbsent(requestedResourceType, it -> doGetInstance(requestedResourceType));
}
@Override
@@ -111,6 +108,10 @@ public Object resolveParameter(ParameterContext parameterContext, ExtensionConte
return store.getOrComputeIfAbsent(parameter.getType(), it -> doGetInstance(parameterizedType));
}
+ private Object doGetInstance(Type parameterizedType) {
+ return findSupplier(parameterizedType).get();
+ }
+
@SuppressWarnings("unchecked")
private static Supplier