I have the following code
public class InstrumentedArquillian extends BlockJUnit4ClassRunner {
static {
net.bytebuddy.agent.ByteBuddyAgent.install();
new ByteBuddy()
.redefine(BaseIT.class)
.method(named("createDeployment"))
.intercept(???)
.annotateMethod(AnnotationDescription.Builder.ofType(Deployment.class).build())
.make()
.load(InstrumentedArquillian.class.getClassLoader(), ClassReloadingStrategy.fromInstalledAgent()).getLoaded();
}
}
public class BaseIT {
public static WebArchive createDeployment() {
return DeploymentBuilder.war();
}
}
I would like to add the annotation Deployment
, method createDeployment
, class BaseIT
without changing any kind of implementation