@Test(expected=NotFoundException.class) public void testDoIt_calls_afterburner_with_after_override_when_no_method() throws CannotCompileException, AfterBurnerImpossibleException, NotFoundException { afterBurnerMock = EasyMock.createMock(AfterBurner.class); CtClass targetClass = ClassPool.getDefault().makeClass( "Target" + TestCounter.testCounter++); builder = new InsertableMethodBuilder(afterBurnerMock, signatureExtractorMock); CtClass classToInsertInto = targetClass; String targetMethod = "foo"; String body = ""; builder .insertIntoClass(classToInsertInto.toClass()) .afterOverrideMethod(targetMethod) .withBody(body) .doIt(); fail(); }
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);  }