Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Spring Boot and Angular

You're reading from   Spring Boot and Angular Hands-on full stack web development with Java, Spring, and Angular

Arrow left icon
Product type Paperback
Published in Dec 2022
Publisher Packt
ISBN-13 9781803243214
Length 438 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Seiji Ralph Villafranca Seiji Ralph Villafranca
Author Profile Icon Seiji Ralph Villafranca
Seiji Ralph Villafranca
Devlin Basilan Duldulao Devlin Basilan Duldulao
Author Profile Icon Devlin Basilan Duldulao
Devlin Basilan Duldulao
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Part 1: Overview of Spring Boot and Angular Development
2. Chapter 1: Spring Boot and Angular – The Big Picture FREE CHAPTER 3. Chapter 2: Setting Up the Development Environment 4. Part 2: Backend Development
5. Chapter 3: Moving into Spring Boot 6. Chapter 4: Setting Up the Database and Spring Data JPA 7. Chapter 5: Building APIs with Spring 8. Chapter 6: Documenting APIs with the OpenAPI Specification 9. Chapter 7: Adding Spring Boot Security with JWT 10. Chapter 8: Logging Events in Spring Boot 11. Chapter 9: Writing Tests in Spring Boot 12. Part 3: Frontend Development
13. Chapter 10: Setting Up Our Angular Project and Architecture 14. Chapter 11: Building Reactive Forms 15. Chapter 12: Managing States with NgRx 16. Chapter 13: Saving, Deleting, and Updating with NgRx 17. Chapter 14: Adding Authentication in Angular 18. Chapter 15: Writing Tests in Angular 19. Part 4: Deployment
20. Chapter 16: Packaging Backend and Frontend with Maven 21. Chapter 17: Deploying Spring Boot and the Angular App 22. Index 23. Other Books You May Enjoy

Writing Tests in Spring Boot

In the previous chapter, you have learned about the importance of loggers, their concepts, and how they can help developers debug and maintain applications. You have learned about Log4j2, which is a third-party framework for Spring Boot that offers several features such as Appenders, Filters, and Markers that can assist in making log events categorized and formatted for developers. We have also discussed SLF4J, which is an abstraction of logging frameworks that allows us to switch between different frameworks during runtime or at deployment, and lastly, we have implemented and configured the logging frameworks with XML configuration and Lombok.

This chapter will now focus on writing unit tests for our Spring Boot application; we will discuss the most commonly used testing frameworks with Java, JUnit, and AssertJ and implement them in our application. We will also be integrating Mockito with our unit test for mocking objects and services.

In this chapter...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime