You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Anindya Bandopadhyay edited this page Jan 24, 2018
·
2 revisions
This framework provides field-level annotations to ignore and test with custom values of primitive & String fields.
Field mark with @IgnoreField annotation will be ignored from testing.
@BooleanTestValue, @ByteTestValue, @CharTestValue, @DoubleTestValue, @FloatTestValue, @IntTestValue, @LongTestValue, @ShortTestValue and @StringTestValue annotations can be used with the respective data type to pass custom values for testing. These annotations have two attributes assignValues and expectedValues, where assignValues is what values will be written to a field using write/setter method and expectedValues what values are expected in unit testing.
Illustration
publicclassTest03 {
@IgnoreFieldprivateintnum1; // Will be ignored@StringTestValue(assignValues={"Andy"},expectedValues = {"ANDY"})
privateStringstr; // may be getter method return an upper case stringprivatebooleanflag;
}