@Test public void testDoIt_calls_afterburner() throws CannotCompileException, AfterBurnerImpossibleException { afterBurnerMock = EasyMock.createMock(AfterBurner.class); afterBurnerMock.addOrInsertMethod((InsertableMethod) EasyMock.anyObject()); EasyMock.replay(afterBurnerMock); builder = new InsertableMethodBuilder(afterBurnerMock, null); CtClass classToInsertInto = CtClass.intType; String targetMethod = ""; String insertionAfterMethod = ""; String fullMethod = ""; String body = ""; builder .insertIntoClass(classToInsertInto) .inMethodIfExists(targetMethod) .afterACallTo(insertionAfterMethod) .withBody(body) .elseCreateMethodIfNotExists(fullMethod) .doIt(); EasyMock.verify(afterBurnerMock); }
public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get( clazzToInsertInto.getName()); return new StateTargetClassSet(); }
InsertableMethodBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get( clazzToInsertInto.getName()); return new StateTargetClassSet(); } }
InsertableMethodBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get( clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableMethodBuilder(AfterBurner afterBurner);  InsertableMethodBuilder(AfterBurner afterBurner,
            CtMethodJavaWriter signatureExtractor); }
InsertableMethodBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get( clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableMethodBuilder(AfterBurner afterBurner);  InsertableMethodBuilder(AfterBurner afterBurner,
            CtMethodJavaWriter signatureExtractor); StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto); StateTargetClassSet insertIntoClass(CtClass classToInsertInto); }
InsertableMethodBuilder { public StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto) throws NotFoundException { this.classToInsertInto = ClassPool.getDefault().get( clazzToInsertInto.getName()); return new StateTargetClassSet(); } InsertableMethodBuilder(AfterBurner afterBurner);  InsertableMethodBuilder(AfterBurner afterBurner,
            CtMethodJavaWriter signatureExtractor); StateTargetClassSet insertIntoClass(Class<?> clazzToInsertInto); StateTargetClassSet insertIntoClass(CtClass classToInsertInto);  }