I'm trying to get to grips with JUnit & Mockito etc.
I currently have a method with the below line.
ObjectMetadata metadata = getMetadata(path.toString());
Is there any way I can mock it? I've tried things like the below
Whitebox.setInternalState(<mock of class>, "metadata", "abc");
but I just get
org.powermock.reflect.exceptions.FieldNotFoundException: No instance field named "metadata" could be found in the class hierarchy of com.amazonaws.services.s3.model.ObjectMetadata.
I think it's because previous use of Whitebox.setInternalState was with variables.
Any info. that might get me started would be appreciated.