Im wondering if the annotations are different with quarkus than with normal mockito. You seem to use @injectmocks to define a mock. and @Inject to inject the mock into a class. Normaly I would expect @Mock for the definition of Mocks (and @Spy for spies) and @InjectMocks to create and initialize the class under test.
Hey Giuseppe, I got some issues mocking my panache queries and I saw you faced similar problems. Is there any proper documentation or how did you solve your problems. Greetz Lukas
Hi Guiseppe! Hope you are fine :-) I have one question: Goto please to movie position 9.15 min --> You create an empty list called movies ... Then you add your own test movie object to this list ... This list will be returned within the Mockito WHEN condition ... So far so good ... In line 42 you get a list of Movie from Response (this ia the entity object of the response which is casted to List) ... Is this list the same list from above? ... I mean your own list in which you added a test movie manually? Thanks in advance and best regards :-)
Hello, yes! It is the same list of above. I did not use any database and in this case I mock the repository forcing (with Mockito) to return my own list in this case an empty one.
Thanks for your time and videos ;) good job! Just a question: is it possible test in a method both RestAssured and Mockito for DB (Mock Repository) together? In this video you show how to mock a response of a repository method and so you call the method by resource bean that call repository method... but is it possible use RestAssured lib for call the API (ex. given().when() .get(....)) and mock a repository method for obtain the mocked response?