CtMethodJavaWriter { public String invokeSuper(CtMethod method) throws NotFoundException { return "super." + method.getName() + "(" + extractParameters(method) + ");"; }  String createJavaSignature(CtMethod overridenMethod); String invokeSuper(CtMethod method);  }
@Test public void testInvokeSuper_without_params() throws CannotCompileException, NotFoundException { CtClass targetClass = ClassPool.getDefault().makeClass( "Target" + TestCounter.testCounter++); CtMethod fooMethod = CtNewMethod.make("public void foo() {}", targetClass); targetClass.addMethod(fooMethod); String extractSignature = signatureExtractor.invokeSuper(fooMethod); assertEquals("super.foo();", extractSignature); }
@Test public void testInvokeSuper_with_params() throws CannotCompileException, NotFoundException { CtClass targetClass = ClassPool.getDefault().makeClass( "Target" + TestCounter.testCounter++); CtMethod fooMethod = CtNewMethod.make("public void foo(int a, String b) {}", targetClass); targetClass.addMethod(fooMethod); String extractSignature = signatureExtractor.invokeSuper(fooMethod); assertEquals("super.foo(p0, p1);", extractSignature); }