mockito / mockito

@@ -25,6 +25,7 @@
Loading
25 25
import java.io.IOException;
26 26
import java.io.ObjectInputStream;
27 27
import java.lang.annotation.Annotation;
28 +
import java.lang.reflect.Method;
28 29
import java.lang.reflect.Modifier;
29 30
import java.lang.reflect.Type;
30 31
import java.util.ArrayList;
@@ -97,10 +98,31 @@
Loading
97 98
            // package private methods.
98 99
            return true;
99 100
        }
101 +
        if (hasNonPublicTypeReference(features.mockedType)) {
102 +
            return true;
103 +
        }
104 +
100 105
        for (Class<?> iface : features.interfaces) {
101 106
            if (!Modifier.isPublic(iface.getModifiers())) {
102 107
                return true;
103 108
            }
109 +
            if (hasNonPublicTypeReference(iface)) {
110 +
                return true;
111 +
            }
112 +
        }
113 +
        return false;
114 +
    }
115 +
116 +
    private static boolean hasNonPublicTypeReference(Class<?> iface) {
117 +
        for (Method method : iface.getMethods()) {
118 +
            if (!Modifier.isPublic(method.getReturnType().getModifiers())) {
119 +
                return true;
120 +
            }
121 +
            for (Class<?> param : method.getParameterTypes()) {
122 +
                if (!Modifier.isPublic(param.getModifiers())) {
123 +
                    return true;
124 +
                }
125 +
            }
104 126
        }
105 127
        return false;
106 128
    }
Files Complexity Coverage
src/main/java/org/mockito 86.16% 84.63%
subprojects 79.07% 84.62%
Project Totals (328 files) 86.07% 84.63%
Notifications are pending CI completion. Waiting for GitHub's status webhook to queue notifications. Push notifications now.
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading