Тёмный

Testing Quarkus application with Junit 5, Mockito and H2 Database | Quarkus Tutorial | Java 

Giuseppe Scaramuzzino
Подписаться 4,7 тыс.
Просмотров 14 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 11   
@kevinfleischer2049
@kevinfleischer2049 Год назад
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.
@Lukas-vx8fr
@Lukas-vx8fr Год назад
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
@iharbakhanovich
@iharbakhanovich Год назад
Thank you a lot. Cool. Could you plese make a video about testing with TestContainers?
@Nini42317
@Nini42317 3 года назад
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 :-)
@GiuseppeScaramuzzino
@GiuseppeScaramuzzino 3 года назад
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.
@giampieropoggi2287
@giampieropoggi2287 2 года назад
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?
@GiuseppeScaramuzzino
@GiuseppeScaramuzzino 2 года назад
Unfortunately not. You cannot use mockito to the MovieResource because you are really use the endpoints.
@joseaugustodossantossilva1149
@joseaugustodossantossilva1149 2 года назад
why choose between mockito and restassure when testing a quarkus web application? cant understand
@kinnisonPaladin
@kinnisonPaladin Год назад
There is no choice to be made: you need both, they solve different needs
@anasabdelkefi7695
@anasabdelkefi7695 3 года назад
Hello ! How can I test a reactive web application with Quarkus ?
@GiuseppeScaramuzzino
@GiuseppeScaramuzzino 3 года назад
Yes, you can do it
Далее
ТЕСТИРОВАНИЕ НА JAVA (JUNIT, MOCKITO)
9:14
Немного заблудился 😂
00:16
Просмотров 263 тыс.
Effective Test Execution With Quarkus
19:40
Просмотров 4,6 тыс.
Testing Quarkus App - Part I
23:12
Просмотров 2 тыс.
Java Testing - JUnit 5 Crash Course
26:05
Просмотров 337 тыс.
Redis за 20 минут
23:22
Просмотров 148 тыс.
Quarkus Tests with TestContainers
10:02
Просмотров 3,1 тыс.
Room Database with Kotlin in Hindi/Urdu
10:17
Немного заблудился 😂
00:16
Просмотров 263 тыс.