This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
1
How to get internalstate of a variable in a protected method of an abstract class?
Post Flair (click to view more posts with a particular flair)
Post Body
Hi, I mocked the abstract with powermockito, which I name absClass. Inside absClass there is a xvalue I want to get the value of when testing in junit. xvalue is inside a protected method. I tried WhiteboxImpl.getInternalState(absClass, "xvalue"); but I get a FieldNotFoundException. No instance field name "xvalue" could be found in the class hierarchy of etc...
How do you access xvalue, which is boolean btw.
Thanks in advance.
Author
Account Strength
90%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
2,724
Link Karma
1,904
Comment Karma
820
Profile updated: 1 day ago
Posts updated: 2 weeks ago
Subreddit
Post Details
We try to extract some basic information from the post title. This is not
always successful or accurate, please use your best judgement and compare
these values to the post title and body for confirmation.
- Posted
- 3 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/learnprogra...