@Test public void testDoIt_calls_afterburner() throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException { afterBurnerMock = EasyMock.createMock(AfterBurner.class); afterBurnerMock.insertConstructor((InsertableConstructor) EasyMock.anyObject()); EasyMock.replay(afterBurnerMock); builder = new InsertableConstructorBuilder(afterBurnerMock); CtClass classToInsertInto = CtClass.intType; String body = ""; builder .insertIntoClass(classToInsertInto) .withBody(body) .doIt(); EasyMock.verify(afterBurnerMock); }
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);  }