diff --git a/src/main/java/io/github/sskorol/core/DataProviderTransformer.java b/src/main/java/io/github/sskorol/core/DataProviderTransformer.java index 97b60b0..70a3144 100755 --- a/src/main/java/io/github/sskorol/core/DataProviderTransformer.java +++ b/src/main/java/io/github/sskorol/core/DataProviderTransformer.java @@ -44,8 +44,8 @@ private DataSupplierMetaData getMetaData(final ITestContext context, final ITest } @SuppressWarnings("FinalLocalVariable") - private void assignCustomDataSupplier(final IDataProvidable annotation, final Method testMethod, - final Class testClass) { + private void assignCustomDataSupplier(final IDataProvidable annotation, final Method testMethod, + final Class testClass) { var dataSupplierClass = getDataSupplierClass(annotation, testClass, testMethod); var dataSupplierAnnotation = getDataSupplierAnnotation(dataSupplierClass, annotation.getDataProvider()); diff --git a/src/main/java/io/github/sskorol/core/IAnnotationTransformerInterceptor.java b/src/main/java/io/github/sskorol/core/IAnnotationTransformerInterceptor.java index e01e213..d75a029 100644 --- a/src/main/java/io/github/sskorol/core/IAnnotationTransformerInterceptor.java +++ b/src/main/java/io/github/sskorol/core/IAnnotationTransformerInterceptor.java @@ -11,8 +11,8 @@ */ public interface IAnnotationTransformerInterceptor { - default void transform(final ITestAnnotation annotation, final Class testClass, - final Constructor testConstructor, final Method testMethod) { + default void transform(final ITestAnnotation annotation, final Class testClass, + final Constructor testConstructor, final Method testMethod) { // not implemented } @@ -20,8 +20,8 @@ default void transform(final IFactoryAnnotation annotation, final Method testMet // not implemented } - default void transform(final IConfigurationAnnotation annotation, final Class testClass, - final Constructor testConstructor, final Method testMethod) { + default void transform(final IConfigurationAnnotation annotation, final Class testClass, + final Constructor testConstructor, final Method testMethod) { // not implemented } @@ -29,7 +29,7 @@ default void transform(final IDataProviderAnnotation annotation, final Method me // not implemented } - default void transform(final IListenersAnnotation annotation, final Class testClass) { + default void transform(final IListenersAnnotation annotation, final Class testClass) { // not implemented } } diff --git a/src/main/java/io/github/sskorol/utils/ReflectionUtils.java b/src/main/java/io/github/sskorol/utils/ReflectionUtils.java index 06483d6..d4bf28f 100644 --- a/src/main/java/io/github/sskorol/utils/ReflectionUtils.java +++ b/src/main/java/io/github/sskorol/utils/ReflectionUtils.java @@ -37,8 +37,9 @@ @UtilityClass public class ReflectionUtils { - public static Class getDataSupplierClass(final IDataProvidable annotation, final Class testClass, - final Method testMethod) { + @SuppressWarnings("unchecked") + public static Class getDataSupplierClass(final IDataProvidable annotation, final Class testClass, + final Method testMethod) { return ofNullable(annotation.getDataProviderClass()) .map(dataProviderClass -> (Class) dataProviderClass) .orElseGet(() -> findParentDataSupplierClass(testMethod, testClass)); @@ -148,8 +149,9 @@ private static Tuple2, String> getFactoryAnnotationMetaData(final ITest return Tuple.of(dataProviderClass, dataProviderMethod); } - private static Class findParentDataSupplierClass(final Method testMethod, final Class testClass) { - return ofNullable(testMethod) + @SuppressWarnings("unchecked") + private static Class findParentDataSupplierClass(final Method testMethod, final Class testClass) { + return (Class) ofNullable(testMethod) .map(m -> Tuple.of(m, new Reflections(m.getDeclaringClass().getPackage().getName()))) .map(findParentDataSupplierClass()) .orElse(testClass);