CRUD JUnit Tests for Spring Data JPA | Testing Repository Layer | Spring Boot | @DataJpaTest

  Рет қаралды 88,957

Java Guides

Java Guides

Күн бұрын

Пікірлер: 74
@nagvraj7859
@nagvraj7859 3 жыл бұрын
Bro Make one video on junit and mockito using all the annotations like real time.
@shashankvishwakarma959
@shashankvishwakarma959 2 жыл бұрын
great work !
@tw5529
@tw5529 3 жыл бұрын
Awesome 👍👍
@nagaraju-ll1gk
@nagaraju-ll1gk 3 жыл бұрын
Super teaching
@AshishRohillax
@AshishRohillax 2 жыл бұрын
Good video. Instead of using a Test method to save data in db to use in other test methods, you could use a sql file to load data in in-memory db.
@livecoding21
@livecoding21 Жыл бұрын
Failed to instantiate [org.springframework.data.jpa.repository.JpaRepository]: Specified class is an interface
@aadiraj6126
@aadiraj6126 3 жыл бұрын
Hey Ramesh bro, can u make a long, fat...Complete junit + mockito videos, with covering major real time scenarios. You've quite smooth flow of teaching.
@MilsonPazienza
@MilsonPazienza 2 жыл бұрын
that would be fantastic
@gokulaher2476
@gokulaher2476 2 жыл бұрын
Hi Ramesh, Do you have any video on how to use the real database like Oracle, MySQL, PostgresSQL etc for running test cases instead of using the in-memory database and also can we see the records/transaction(without rollback) in the database tables created by test cases? what configuration is required to do the same ?
@francksgenlecroyant
@francksgenlecroyant Жыл бұрын
In that case you should create a configuration file, a regular properties or yml file under src/test/resources/ and spring is smart enough to detect that when you run your tests, you can configure your desired database in that file. But it's not recommended. Instead, you should make sure you use the in-memory database in your test cases to avoid hitting the real database.
@sanketlondhe7725
@sanketlondhe7725 2 жыл бұрын
i have watched your several videos on react integration with spring boot for crud operation and now this video, you are awesome , you deserve 10 x subscriber than this
@evgeniyosis613
@evgeniyosis613 3 жыл бұрын
Please, make video series where you testing all layers in a simple crud application
@kulkarniprabhakar290
@kulkarniprabhakar290 6 ай бұрын
Guys in case you are unable to use builder patters and it says "The method builder() is undefined for the type Employee" please make sure you have the project lombok configured in your working IDE.
@ivanpassalia8244
@ivanpassalia8244 2 жыл бұрын
Thanks! this video help me a lot to complete my first testing unit, i cant found a way to create a testing database to check my CRUD and routes! and you answered all at the same time!!!
@SuyashChahande-g7p
@SuyashChahande-g7p Жыл бұрын
Thank you @javaGuides
@vndprasadgrandhi7024
@vndprasadgrandhi7024 3 жыл бұрын
Hi Bro, Firstly thank you very much for creating wonderful video. If we need test service layer with Junit. How we will do. If possible do the video on this concept plz. Its very useful for everyone.
@praveenl1800
@praveenl1800 3 жыл бұрын
yes I am also looking for the same.. please make a video on testing service layer class
@pranavmahajan4190
@pranavmahajan4190 3 жыл бұрын
I have a request, can you please cover EntityManager testing with Mockito?
@privateuser047
@privateuser047 3 жыл бұрын
Awesome video. Explanation is on another level. Somehow, I end up here for solution. Thanks. Java Guides 🙂
@abelteshome9429
@abelteshome9429 2 жыл бұрын
if you're facing an error related to @DatajpaTest annotation you have to add this @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) annotation
@Shiva_Codes
@Shiva_Codes 3 жыл бұрын
@JavaGuides Please make more videos on these JUnit Testing with different kinds of apps not just CRUD based apps
@parthdeveloper2793
@parthdeveloper2793 3 жыл бұрын
Good tutorial ❤️🙌 Can you please make a video on junit testing for DynamoDb with controller and service layer code.
@UpThrustt
@UpThrustt 8 ай бұрын
Not able to call the lambkok bulder() method in test method
@revathiruby8541
@revathiruby8541 9 ай бұрын
Npe while accessing the repository
@DeepakGupta-hj2dv
@DeepakGupta-hj2dv 3 жыл бұрын
Sir please make on video spring boot unit testing crash course
@DeepakGupta-hj2dv
@DeepakGupta-hj2dv 3 жыл бұрын
please make on video spring boot microservices tutorial
@mahammadrafimulla9093
@mahammadrafimulla9093 2 жыл бұрын
Nice explanation
@Gaurav-wy2wm
@Gaurav-wy2wm 3 жыл бұрын
Sir please tell difference between @Bean and @Autowired
@vishalr1140
@vishalr1140 2 жыл бұрын
Hi, I added lombok dependency. But .builder is not working in employeeRepositoryTests. How to solve ?
@mathewsxavier1523
@mathewsxavier1523 2 жыл бұрын
bro what is the point of testing the inbuilt jpa methods? if there is any custom method you wrote inside repo that can be tested. all these save, find are tested by the spring team.
@harifactsandupdates
@harifactsandupdates 2 жыл бұрын
Hii while using lambok it's asking license can u help??
@sarfarazraj2865
@sarfarazraj2865 2 жыл бұрын
Your Videos are very good please do something for the low sound, I can't hear you clearly.
@beastbaby7946
@beastbaby7946 2 жыл бұрын
failed to load application context error pls fix
@meenajadhav5533
@meenajadhav5533 3 жыл бұрын
Very simple tutorial with line by line coding 👌
@mayurimule8188
@mayurimule8188 2 жыл бұрын
assertThat is not working, how to fix it
@JavaGuides
@JavaGuides 2 жыл бұрын
You need to import Assertions class from assertJ library. Example: import org.assertj.core.api.Assertions;
@mayurimule8188
@mayurimule8188 2 жыл бұрын
@@JavaGuides yeah did that, but its not working
@Annamfashion
@Annamfashion 3 жыл бұрын
Why use lombok dependency Instead of which one used
@JavaGuides
@JavaGuides 3 жыл бұрын
If you don't want to use lombok then remove lombok dependency from pom. xml and add getters/setters methods in JPA entity.
@harshpalsingh1145
@harshpalsingh1145 2 жыл бұрын
Instead of using DB, you should have just used Mock to fake the DB operations.
@rijavumrania3097
@rijavumrania3097 2 жыл бұрын
hi, i already have an employee management system app created with springboot and configured with mysql, but these tests aren't running, throwing errors such as "table not found" and "could not prepare statement". I'm using constructor in the save employee method (not Builder). can someone please help me?
@tresornaruffygo1816
@tresornaruffygo1816 2 жыл бұрын
those test are meant to use an enbedded h2 database, for mysql you have to disable autoconfiguration for @DataJpaTest
@java_lover
@java_lover 2 жыл бұрын
Very good teaching tq
@ken42923
@ken42923 3 жыл бұрын
Hi bro your videos are awesome could you please make relationship like one to one many to one thise working with spring data jpa
@JavaGuides
@JavaGuides 3 жыл бұрын
These videos are already available on this channel
@vndprasadgrandhi7024
@vndprasadgrandhi7024 3 жыл бұрын
Great video bro.. Thanks
@shubhamdalvi7550
@shubhamdalvi7550 2 жыл бұрын
Awesome video clear all the concepts 👍
@sharvaridesai4580
@sharvaridesai4580 2 жыл бұрын
I have used @DataJpaTest annotation but it's giving error as "failed to load application context error". Please help
@alpt1980
@alpt1980 Жыл бұрын
how u solved this ,i cant solve . so annoying
@Shiva_Codes
@Shiva_Codes 3 жыл бұрын
@JavaGuides Please add TimeStamps of Sub-Topics in this video in description
@Shiva_Codes
@Shiva_Codes 3 жыл бұрын
thank u
@goofyTavern
@goofyTavern 3 жыл бұрын
WoW! Really cool 😎
@javatechnology4481
@javatechnology4481 3 жыл бұрын
Excellent video
@tresornaruffygo1816
@tresornaruffygo1816 2 жыл бұрын
those aren't unit tests
@harifactsandupdates
@harifactsandupdates 2 жыл бұрын
While using Lombok getting license error what to do???
@JavaGuides
@JavaGuides 2 жыл бұрын
What is the error? Can you paste here
@harifactsandupdates
@harifactsandupdates 2 жыл бұрын
@@JavaGuides copyright 2022 the original author or authors,licensed under Apache,version 2.0(you may not use this file except in compliance with. You may obtain a copy of the license at.....link given
@harifactsandupdates
@harifactsandupdates 2 жыл бұрын
@@JavaGuides it's showing builder() is undefined for the type employee
@JavaGuides
@JavaGuides 2 жыл бұрын
@@harifactsandupdates which IDE you are using?
@JavaGuides
@JavaGuides 2 жыл бұрын
If you are using IntelliJ IDEA then restart it. If you are using Eclipse STS then you need to install Lombok first.
@sanketlondhe7725
@sanketlondhe7725 2 жыл бұрын
builder() is not working
@JavaGuides
@JavaGuides 2 жыл бұрын
install Lombok library in your IDE
@JavaGuides
@JavaGuides 2 жыл бұрын
If you are using IntelliJ then restart again will work
@sanketlondhe7725
@sanketlondhe7725 2 жыл бұрын
I am using sts and i have added dependency
@sanketlondhe7725
@sanketlondhe7725 2 жыл бұрын
Annotation is able to import but builder() method is not working
@JavaGuides
@JavaGuides 2 жыл бұрын
@@sanketlondhe7725 install lombok in STS. refer my video at kzbin.info/www/bejne/jIOah5Sfja19e7s
@techakash7026
@techakash7026 2 жыл бұрын
sir builder() method not working in my system I followed you step by step in this video
@JavaGuides
@JavaGuides 2 жыл бұрын
Install Lombok library in your STS IDE
@techakash7026
@techakash7026 2 жыл бұрын
@@JavaGuides thank you I fix It
@dusmannalinwad
@dusmannalinwad 2 жыл бұрын
please publish the code via GitHub.!
Spring Data REST Tutorial | Crash Course ✅
48:46
Java Guides
Рет қаралды 22 М.
Java Unit Testing with JUnit - Tutorial - How to Create And Use Unit Tests
21:35
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 55 МЛН
Man Mocks Wife's Exercise Routine, Faces Embarrassment at Work #shorts
00:32
Fabiosa Best Lifehacks
Рет қаралды 6 МЛН
Minecraft Creeper Family is back! #minecraft #funny #memes
00:26
小路飞嫁祸姐姐搞破坏 #路飞#海贼王
00:45
路飞与唐舞桐
Рет қаралды 10 МЛН
🔥🔥Unit Testing in Spring Boot Project in one video ||  Crash Course
58:18
Learn Code With Durgesh
Рет қаралды 210 М.
Negative Time is Real, Physicists Confirm. Kind Of.
6:59
Sabine Hossenfelder
Рет қаралды 15 М.
'BIG MISTAKE': Israeli diplomat warns Iran 'don't mess with us'
5:41
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 55 МЛН