I have a java class say Class A with some methods already present, I am generating a class using code model say classB
and while generating using code model I am trying to call one the method of that classA
.
i tried below
method
.body()
.invoke(JExpr.ref(helper), "display")
.arg("hello");
but it is not working, I will really appreciate if someone knows how to do the same
I want to generate a method like:
public void method() {
Helper helper = new Helper();
helper.display("hello")
}
I am also interested in how I can generate the following method:
@Test
public void method() {
Assert.fail("message")
}