return configuration.getImplementation() == MockImplementation.JAVA;
}
public Object create(IMockConfiguration configuration, Specification specification) {
if (Modifier.isFinal(configuration.getType().getModifiers())) {
throw new CannotCreateMockException(configuration.getType(),
" because Java mocks cannot mock final classes. If the code under test is written in Groovy, use a Groovy mock.");
}
if (configuration.isGlobal()) {
throw new CannotCreateMockException(configuration.getType(),
" because Java mocks cannot mock globally. If the code under test is written in Groovy, use a Groovy mock.");
}
MetaClass mockMetaClass = GroovyRuntimeUtil.getMetaClass(configuration.getType());
IProxyBasedMockInterceptor interceptor = new JavaMockInterceptor(configuration, specification, mockMetaClass);