EIEIOTECHNOVATION
← Training programmes

EIEIO / PROGRAMMING & DEVELOPMENT

Java Spring Unit Test Script Writing

Course outline

5 days

Duration

Java Spring Unit Test Script Writing

5 days

Overview

By the end of this course, you will have learnt about:

  • Spring and its approach to Dependency Injection
  • Spring Testing
  • Spring Boot 2 architecture
  • Developing a production-ready application
  • Spring Web MVC applications
  • How to implement Spring REST services
  • Spring Data
  • Developing Spring JMS applications using Spring Boot
  • Platform Integration
  • The internals of Spring Boot and how to modify its default behaviour
  • The role of Spring Actuator

Who should attend?

Any Java developer who needs to understand Spring Boot 2, its relationship to the Spring Framework and how to use Spring Boot effectively.

Prerequisites

Delegates should be comfortable with Java language, syntax, and object-oriented application development principles. Ideally familiarity with Java 8+.

Course Contents

Spring Boot Overview

  • Motivation behind Spring
  • What is Spring
  • The Spring Framework
  • Spring Boot Library
  • Motivation
  • Key Features inc Auto-configuration, Standalone, Opinionated
  • Maven configuration
  • Spring Intializr

First Spring Boot Application

  • Spring Boot CLI
  • Using Maven and Gradle
  • IDE Support
  • Spring boot auto-configuration
  • Creating a Hello World Application
  • Packaging Spring Boot applications

Spring Beans and DI

  • Spring Beans
  • Spring Container
  • Spring Context config files
  • Bean Scoping
  • Spring Annotations
  • Java Config approach
  • Lambda approach
  • Mixing XML and annotations
  • Inversion of Control and Dependency Injection
  • Spring Dependency Injection
  • Wiring Beans together

Spring Web MVC

  • Introduce Spring Web MVC
  • Present flow through MVC
  • Creating a simple Web MVC application using Spring Boot Initializr
  • Defining a Controller
  • Handling view resolution
  • Building and Deploying
  • Java Config web applications
  • WebAppInitializer class
  • Spring Java Config class

Spring Boot and RESTful Services

  • Web Services
  • What is REST
  • Spring REST
  • Building a Spring REST application
  • Introduce Spring REST Clients
  • Spring REST Template

Spring Data and Spring Boot

  • Creating a Spring Data project using Spring Book Intiializr
  • Data Access objects
  • Spring DAO
  • Working with JDBC
  • Spring DAO Exception Hierarchy
  • Using Object Mappers
  • Exploiting JPA (and Hibernate)
  • Integrating NoSQL (MongoDB) databases
  • Creating Data Access Objects
  • Persistence with JPA Repositories
  • JPA, EntityManagers, Entity Classes, Annotation mappings
  • Spring JPA Data, CrudRepository, PagingAndSortingRepository
  • Spring Data Rest, Exposing Databases as Endpoints
  • HATEOAS JSON
  • @Projections and Excerpts
  • Restrict the data sent back to the client

Spring JMS and Spring Boot

  • Basic idea of message queues
  • point-to-point
  • publish and subscribe (pub-sub)
  • RabbitMQ message server with Spring Boot
  • JMS (Java Message Service)
  • Spring JMS Development
  • Spring POJO bean as a message consumer

Integration with the Spring ecosystem

  • Using XML and Annotation configuration
  • Using JavaConfig

Spring Boot Internals and Defaults

  • SpringApplication class
  • Custom Banner configuration
  • SpringApplication Builder
  • ApplicationRunner and CommandLineRunner configuration
  • Custom Properties Prefix
  • Creating a Spring Boot Starter project

Spring Boot and Spring Test

  • Introduce Testing with Spring
  • Highlight Test Support in Spring
  • JUnit 5.x
  • Spring and JUnit 5.x
  • Spring Boot Testing Framework
  • Integration test
  • Performance test

Security with Spring Boot

  • Spring Security
  • Security with Spring Boot
  • Fundamental Elements
  • Spring Security Managers
  • Spring Web Applications
  • Other Authentication providers
  • Configuring Spring for Security
  • Method Security
  • Defining Method level Security
  • Annotation Based Method Security
  • Alternative Annotations

Spring Boot Actuator

  • Spring Boot Actuator Module
  • Actuator End Points
  • Changing the Endpoint ID
  • Actuator CORS support
  • Changing the Management Endpoints Path
  • Securing Endpoints
  • Implementing Custom Actuator Endpoints
  • Spring Boot Actuator health
  • Spring Boot Actuator metrics

Programme scope, delivery arrangements and suitability are confirmed during enquiry.