Spring Boot Unit Testing With Mockito - 1. First Unit Test

preview_player
Показать описание
Spring Boot Unit Testing - 1. First Unit Test

Рекомендации по теме
Комментарии
Автор

Most underrated channel, the vast of many tutorial channels in youtube.

tejeswar
Автор

Teddy you helped me a lot ! May God bless you

house_d
Автор

Just wanted to add this in case you a newer developer that does not feel comfortable using git to time travel back before I wrote unit tests. Feel free to clone project and just delete Controller, Service, and Repository folders inside Test to follow along.

TeddySmithDev
Автор

If you are following TDD, should you write the tests out first before writing the code? Then change the code to pass the test as opposed to changing the test itself?

paulallen
Автор

Honest question: why are you testing JPARepository methods?
Unless you have custom code in your repo's, wouldn't you skip that, and focus on the service and controller layers?

(I assume you're mostly using the automagic methods, and not JPQL, or native SQL)

jasongoossens
Автор

Can you help me to solve this problems:
- When I used 2 annotations the same as you: @DataJpaTest and @AutoConfigureTestDatabase, I got an error: Error creating bean with name defined in class path resource. And I can't find any ways to fix it.
- When I changed it to @SpringBootTest, everything works fine.
Thank you for your help and answers.

TrungRichie
Автор

Why is the entity class is not identified in the reposoitory test class

eizdefg
Автор

Isn't Arrange Act Assert affiliated with TDD and Given When Then with BDD?

lloyd
Автор

Could you please suggest any documentation why you have used @mockBean in ControllerTest and @Mock in service

ShubhamSingh-xubo
Автор

Thank you very much for your video. My tests are passing, but I'm getting the following warning: "Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended." While some sources say this is a non-critical error if the tests pass, others suggest otherwise. Should I be concerned?

Camupof
Автор

Which tool do you use for drawing schemes ? It's doesnt look like draw io or Excali.

erengunduzvar
Автор

Does this also work if i use MySql as the Database in the main package?

woistdasniveau
Автор

Hi Teddy, good job and thank you for the tutorial, but i can not use the builder method in the PokemonRepositoryTests class even i added the @Builder in the pokemon model. do you have any explanation?

theodulesaintil
Автор

Thanks for the tutorial. I noticed that the junit dependency is already present in the spring-boot-starter-test, so I guess there's no point in adding it again, right?

eduefuz
Автор

Dude, say what you type, helps us follow along better.

chanprakash
Автор

This topic should be a strand alone topic, and should be baby steps, i have a total of 45 min experience with testing and i cant follow along.

yesno
Автор

hello teddy, i have this problem : Cannot invoke because "this.garageRepo" is null
Can you please help me..

jnjpyug