-
Notifications
You must be signed in to change notification settings - Fork 0
5. Method
Anindya Bandopadhyay edited this page Jan 18, 2018
·
2 revisions
This framework provides method level annotations to create complex object @CreateObjectMethod and to map @ReadMethod & @WriteMethod to a field.
To create complex object developer should/can use a static non-parameterized public method to create an object of the class which will be unit tested.
@CreateObjectMethod
public static MyClass05 createObject(){
MyClass05 myClass05 = new MyClass05();
if(myClass05.ch == 'F'){
throw new IllegalAccessError();
}
return myClass05;
}
In many cases it happen that read(getter)/write(setter) method of field does not comply with JavaBeans standard. So in this framework developer can map field with non-standard read/write method.
@ReadMethod(fieldName="flag")
public boolean hasFlag(){
return flag;
}
@WriteMethod(fieldName="flag")
public void writeFlag(boolean flag) {
this.flag = flag;
}