@@ -0,0 +1,1240 @@
+package com.github.sbugat;%0A%0Aimport java.lang.annotation.Annotation;%0Aimport java.lang.reflect.Field;%0A%0Aimport org.junit.After;%0Aimport org.mockito.Mock;%0Aimport org.mockito.Mockito;%0A%0A/**%0A * Generic test class to automatic check of all Mock marked with @Mock annotation by using verifyNoMoreInteractions on them.%0A * %0A * @author Sylvain Bugat%0A * %0A */%0Apublic abstract class GenericMockitoTest %7B%0A%0A%09@After%0A%09public void verifyNoMoreInteractionsAllMocks() throws IllegalArgumentException, IllegalAccessException %7B%0A%0A%09%09Class%3C? extends GenericMockitoTest%3E currentClass = this.getClass();%0A%09%09while (null != currentClass) %7B%0A%0A%09%09%09for (final Field field : currentClass.getDeclaredFields()) %7B%0A%0A%09%09%09%09final Annotation annotation = field.getAnnotation(Mock.class);%0A%0A%09%09%09%09if (null != annotation) %7B%0A%0A%09%09%09%09%09if (field.isAccessible()) %7B%0A%09%09%09%09%09%09Mockito.verifyNoMoreInteractions(field.get(this));%0A%09%09%09%09%09%7D else %7B%0A%09%09%09%09%09%09field.setAccessible(true);%0A%09%09%09%09%09%09Mockito.verifyNoMoreInteractions(field.get(this));%0A%09%09%09%09%09%09field.setAccessible(false);%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%0A%09%09%09@SuppressWarnings(%22unchecked%22)%0A%09%09%09final Class%3C? extends GenericMockitoTest%3E uncheckedCurrentClass = (Class%3C? extends GenericMockitoTest%3E) currentClass.getSuperclass();%0A%09%09%09currentClass = uncheckedCurrentClass;%0A%09%09%7D%0A%09%7D%0A%7D%0A

Add generic test class