I have the following Pojo:
public class Football extends Item { public Football(Colour colour, Double price ) { super(colour, 18.99); } public Double getPrice() { return price; } } I thought that when I created my mock in unit test as such:
@Mock Football football; @BeforeEach private void initMocks() { MockitoAnnotations.openMocks(this); } When I call the method getPrice() on my football mock - I should get 18.99 back as the price is hardcoded in the constructor params. However I do not.
Why is this the case?