@DataJpaTest example for Spring Data Repository Unit Test

Nowadays Unit Test is so important in Software Development, and Spring Framework also provides @DataJpaTest annotation to make writing test for JPA Repository more simpler. In this tutorial, we’re gonna look at how to apply @DataJpaTest in our Spring Boot Project with TestEntityManager, then run with JUnit 5.

This tutorial gives you an additional unit test for the Post:
Spring Boot, Spring Data JPA: CRUD example

More Practice:
Spring Boot – test Rest Controller with @WebMvcTest
JPA Repository query example in Spring Boot
Spring Boot Token based Authentication with Spring Security example
Spring Boot @ControllerAdvice & @ExceptionHandler example

Associations:
Spring Boot One To One example with JPA, Hibernate
Spring Boot One To Many example with JPA, Hibernate
Spring Boot Many to Many example with JPA, Hibernate

Read More

Spring Boot + Angular 8 example: Build a CRUD App

In this tutorial, we will learn how to build a full stack Spring Boot + Angular 8 example with a CRUD App. The back-end server uses Spring Boot with Spring Web MVC for REST Controller and Spring Data JPA for interacting with embedded database (H2 database). Front-end side is made with Angular 8, HttpClient, Router and Bootstrap 4.

Newer versions:
Angular 12 + Spring Boot: CRUD example

More Practice:
Angular 8 + Spring Boot: JWT Authentication with Spring Security example
Angular 8 + Spring Boot + MySQL example: CRUD App
Angular 8 + Spring Boot + PostgreSQL example: CRUD App
Angular 8 + Spring Boot + MongoDB example: CRUD App
Angular 8 + Spring Boot: File upload example
Angular 8 + Spring Boot: Pagination example

Serverless:
Angular 8 Firebase CRUD Realtime DB | AngularFireDatabase

Read More

Spring Boot: Upload & Read CSV file into MySQL Database | Multipart File

A CSV (comma-separated values) file is a plain text file that contains data which format is described in RFC4180. Each row has a number of fields, separated by commas. Each line should contain the same number of fields throughout the file. In this tutorial, I will show you how to upload, read CSV file data and store into MySQL Database using Spring Boot & Apache Commons CSV.

Related Posts:
Spring Boot Multipart File upload example
How to upload multiple files in Java Spring Boot
Spring Boot Download CSV file from Database example

Excel file instead:
Spring Boot: Upload/Import Excel file data into MySQL Database

Deployment:
Deploy Spring Boot App on AWS – Elastic Beanstalk
Docker Compose: Spring Boot and MySQL example

Read More

Spring Boot: Upload/Import Excel file data into MySQL Database

The Excel file is a spreadsheet file format created by Microsoft for use with Microsoft Excel. You can use the file to create, view, edit, analyse data, charts, budgets and more. In this tutorial, I will show you how to upload/import Excel file data into MySQL Database using Spring Boot & Apache POI, then export Rest API to return Excel file from database table.

Related Posts:
Spring Boot Multipart File upload example
How to upload multiple files in Java Spring Boot
Upload/Import CSV file to MySQL Database in Spring Boot
Spring Boot: Download Excel file from MySQL database table

Deployment:
Deploy Spring Boot App on AWS – Elastic Beanstalk
Docker Compose: Spring Boot and MySQL example

Read More