Spring Boot Unit Testing With Mockito - Mocking Explained

  Рет қаралды 35,853

Teddy Smith

Teddy Smith

Күн бұрын

Пікірлер: 22
@mattcummings737
@mattcummings737 Жыл бұрын
Great videos! Quick nerd note, I believe that the logic is inverted on the way you described non-deterministic. The way you described how we want unit test to have stable and reproducible output is deterministic.
@lexerthefirst9533
@lexerthefirst9533 11 күн бұрын
Yes exactly.
@alma89732
@alma89732 Жыл бұрын
Man your explanation was so good and helped me to understand perfectly what I had to do. Really really thank you, I had been struggling with this for a while and you saved me!
@waltzofthestars2078
@waltzofthestars2078 6 ай бұрын
Thanks for the great video, helped me a lot understand mocking. Only a small remark from me: deterministic literally means "something that can be determined"(each and every time). We want the tests to be deterministic, e.g. have the exact same output for the same input each and every time.
@andreferreira4327
@andreferreira4327 Жыл бұрын
Did you mean deterministic?
@Anon-jz7iw
@Anon-jz7iw 11 ай бұрын
I think so, google is saying deterministic is the correct wording.
@jasper5016
@jasper5016 11 ай бұрын
This is top notch content. Thanks. Can you please cover all this in more detail? I would appreciate if you can cover Integration testing as well. Please take some common examples like Students or Employee.
@TeddySmithDev
@TeddySmithDev 11 ай бұрын
Yes, I’m in C# right now but once done will be back in Java. Thanks for commenting!
@lenigaussgauss2428
@lenigaussgauss2428 11 ай бұрын
You well explained the principal of Mockito but didn't explained how each of them works. When do we need to use Mockito.any(...), mockito.mock(...), when()... And what does all these methods do ?
@piotrjaga6929
@piotrjaga6929 Жыл бұрын
Did you mean non-random? because you said non-deterministic is when you always get the same result for the same input, but this is fully deterministic then
@luishenriquedossantos8183
@luishenriquedossantos8183 Жыл бұрын
This is gold man, thank you so much
@sarpyldrm7734
@sarpyldrm7734 7 ай бұрын
It seems I am the only only who didn't find explanation good. Everyone seems to be liked it but I feel you didn't even explain. You only coded yourself.
@martinmatovcik7918
@martinmatovcik7918 Жыл бұрын
Really good explanation! thanks😉
@paulallen4622
@paulallen4622 6 ай бұрын
Hi @Teddy Smith is there any videos where you show the creation of this project from scratch? Or was this just an example specifically for the testing videos?
@TeddySmithDev
@TeddySmithDev 6 ай бұрын
I have a spring boot playlist that the course is built from. It’s on channel. I’d post link but I’m on mobile right now.
@jonastimo6582
@jonastimo6582 Жыл бұрын
great video, thank you! That was very helpful. One question though: You have been injecting the implementation of pokemonService. Does it have to be the class? Could we possibly use the interface instead and have mockito decide which class to use (maybe with some attribute added for specification, in case there is more than one implementation around)? e. g. Spring Autowiring would allow doing so
@Vedant-ts2gf
@Vedant-ts2gf 11 ай бұрын
In test environment springboot don't provide the functionality of dependency injection. so for that you will need to add annotations over class. (i.e @SpringBootTest & @RunWith(SpringRunner.class)).
@cityrunner-x3x
@cityrunner-x3x 10 ай бұрын
when(pokemonRepository.save(Mockito.any(Pokemon.class))).thenReturn(pokemon) how come this test case can be passed? pokemon object is built using builder pattern.
@whitestar7648
@whitestar7648 2 жыл бұрын
Thx dude , really appreciate it
@daoudasylla91
@daoudasylla91 Жыл бұрын
Thx you man. What application do you use for your note ? I like the hand writer
@rahuljha5308
@rahuljha5308 3 ай бұрын
1
Spring Boot Unit Testing With Mockito - Service Layer
5:26
Teddy Smith
Рет қаралды 29 М.
Spring Boot Unit Testing With Mockito - 1. First Unit Test
14:42
Teddy Smith
Рет қаралды 112 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
小丑女COCO的审判。#天使 #小丑 #超人不会飞
00:53
超人不会飞
Рет қаралды 16 МЛН
СИНИЙ ИНЕЙ УЖЕ ВЫШЕЛ!❄️
01:01
DO$HIK
Рет қаралды 3,3 МЛН
Кирилл Толкачёв - Тестируем и плачем вместе со Spring Boot Test
1:03:41
Heisenbug — конференция по тестированию
Рет қаралды 22 М.
Spring Boot Unit Testing With Mockito - Service Layer [Part 2]
20:04
Java Unit Testing with JUnit - Tutorial - How to Create And Use Unit Tests
21:35
Deep Dive into REST API Design and Implementation Best Practices
12:02
Software Developer Diaries
Рет қаралды 71 М.
Stop Using Mocking in Unit Testing! | Code Cop #020
10:46
Nick Chapsas
Рет қаралды 50 М.
Spring Boot Unit Testing With Mockito - Repository [Part 1]
9:44