Spring Boot Unit Testing With Mockito - Service Layer [Part 2]

  Рет қаралды 12,903

Teddy Smith

Teddy Smith

Күн бұрын

Пікірлер: 8
@Nyze1984
@Nyze1984 Жыл бұрын
Maybe also test the cases where exceptions are thrown?
@wantedlepota9960
@wantedlepota9960 Ай бұрын
yes, somethig like this: ResourceNotFoundException exception = assertThrows(ResourceNotFoundException.class, () -> { personService.deletePersonById(personID); });
@rohansahu1212
@rohansahu1212 8 ай бұрын
Awesome ❤
@SomethingGood10
@SomethingGood10 2 жыл бұрын
Very good
@goshochernii
@goshochernii 7 ай бұрын
what is the difference between just this review.setPokemon(pokemon); and doing that pokemon.setReviews(Arrays.asList(review)); review.setPokemon(pokemon);
@Grainme47
@Grainme47 6 ай бұрын
yeah I've got the same question!
@pcgame-f1o
@pcgame-f1o 6 ай бұрын
In this specific case test, if we focus on the line 58 where we have the if(logic). You will note that the scenarios is looking if in the review has the pokemon_id. After that, the second act, just get the pokemon_id. After that, has been a comparation if the id inside the pokemon_review is equals pokemon_id If in this scenario we set like this: pokemon.setReviews(Arrays.asList(review)); the condition at line 58 will not be true, cause we wasn't set the pokemon_id into the review object. I hope this was helpfully.
Spring Boot Unit Testing With Mockito - Controllers
9:08
Teddy Smith
Рет қаралды 41 М.
Spring Boot Unit Testing With Mockito - Mocking Explained
15:30
Teddy Smith
Рет қаралды 32 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 16 МЛН
Кто круче, как думаешь?
00:44
МЯТНАЯ ФАНТА
Рет қаралды 4,3 МЛН
They Chose Kindness Over Abuse in Their Team #shorts
00:20
I migliori trucchetti di Fabiosa
Рет қаралды 12 МЛН
Spring Boot testing: Zero to Hero by Daniel Garnier-Moiroux
2:42:32
Spring Boot Unit Testing With Mockito - Controllers [Part 4]
13:38
Unit Test with Mockito in Flutter
11:26
AI with Flutter
Рет қаралды 3,5 М.
Test Driven Development (TDD) in Spring
51:09
Dan Vega
Рет қаралды 28 М.
4 Spring Boot Mistakes to AVOID in 2024
15:18
Java Brains
Рет қаралды 63 М.
Java Unit Testing with JUnit - Tutorial - How to Create And Use Unit Tests
21:35
10 Spring and Spring Boot Common Mistakes You Need To STOP
15:49
Amigoscode
Рет қаралды 156 М.
Spring Boot Testcontainers - Integration Testing made easy!
33:31
5 Java concepts you MUST KNOW!!
11:50
Amigoscode
Рет қаралды 310 М.