Andy Langer
unread,Apr 28, 2022, 6:42:51 PM4/28/22Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mockito
I'm having issues getting mockito-inline to handle a case that I would encounter when using PowerMock; mocking a construction, but only when certain arguments are in the construction.
For example
```
PowerMockito.whenNew(Car.class).withArguments("Red", "Four Wheels", "Expensive").thenReturn(mockedCar);
```
With mockito-inline, I can mock the construction of a Car by doing
```
try (MockedConstruction<Car> mockedCar = Mockito.mockConstruction(Car.class)){
Car c = mockedCar.generated().get(0);
verify(c).someBehavior();
}
```
This does not allow me to only generate a mock when I have specific constructor arguments though. Does anybody know how to do this in mockito-inline?