String identifier = RandomString.make(); subclassEngine = new TypeCachingBytecodeGenerator(new SubclassBytecodeGenerator(withDefaultConfiguration() .withBinders(of(MockMethodAdvice.Identifier.class, identifier)) .to(MockMethodAdvice.ForReadObject.class), isAbstract().or(isNative()).or(isToString())), false); mockTransformer = new AsmVisitorWrapper.ForDeclaredMethods()
/** * Creates a binder for binding a fixed value to a given annotation. * * @param type The type of the annotation that is bound by this binder. * @param value The value that is assigned to any annotated parameter. * @param <V> The bound annotation's type. * @return A parameter binder that binds the given annotation to the supplied value. */ public static <V extends Annotation> ParameterBinder<V> of(Class<V> type, Object value) { return new OfConstant<V>(type, value); }