@Test public void testCheckAllFields_should_succeed_with_all_fields_defined_using_class() throws Exception { String body = ""; Class<?> classToInsertInto = String.class; ; InsertableConstructor constructor = builder .insertIntoClass(classToInsertInto ) .withBody(body) .createInsertableConstructor(); assertNotNull(constructor); assertEquals(ClassPool.getDefault().get(String.class.getName()), constructor.getClassToInsertInto()); assertEquals(body, constructor.getConstructorBody(null)); assertTrue(constructor.acceptParameters(null)); }
public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get(clazzToInsertInto.getName()); return new StateTargetClassSet(); }
InsertableConstructorBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get(clazzToInsertInto.getName()); return new StateTargetClassSet(); } }
InsertableConstructorBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get(clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableConstructorBuilder(AfterBurner afterBurner); }
InsertableConstructorBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get(clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableConstructorBuilder(AfterBurner afterBurner); StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto); StateTargetClassSet insertIntoClass(CtClass clazzToInsertInto); }
InsertableConstructorBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get(clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableConstructorBuilder(AfterBurner afterBurner); StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto); StateTargetClassSet insertIntoClass(CtClass clazzToInsertInto);  }