List of Listings

Chapter 1. Bootstarting Spring

Listing 1.1. A complete Groovy-based Spring application

Chapter 2. Developing your first Spring Boot application

Listing 2.1. ReadingListApplication.java is both a bootstrap class and a configuration class

Listing 2.2. @SpringApplicationConfiguration loads a Spring application context

Listing 2.3. Using the Spring Boot Gradle plugin

Listing 2.4. Using the Spring Boot Maven plugin and parent starter

Listing 2.5. The Book class represents a book in the reading list

Listing 2.6. A Spring MVC controller that fronts the reading list application

Listing 2.7. The Thymeleaf template that presents a reading list

Chapter 3. Customizing configuration

Listing 3.1. Explicit configuration to override auto-configured security

Listing 3.2. A repository interface for persisting readers

Listing 3.3. A JPA entity that defines a Reader

Listing 3.4. ReadingListController modified to accept an Amazon ID

Listing 3.5. Capturing configuration properties in a bean

Listing 3.6. ReadingListController injected with AmazonProperties

Listing 3.7. Custom error page for the reading-list application

Chapter 4. Testing with Spring Boot

Listing 4.1. Integration testing Spring with SpringJUnit4ClassRunner

Listing 4.2. Creating a Mock MVC for integration testing controllers

Listing 4.3. Testing the post of a new book

Listing 4.4. Testing a secured method with user authentication

Listing 4.5. Testing a web application in-server

Listing 4.6. A template for Selenium testing with Spring Boot

Listing 4.7. Testing the reading-list application with Selenium

Chapter 5. Getting Groovy with the Spring Boot CLI

Listing 5.1. A Groovy and JDBC implementation of ReadingListRepository

Listing 5.2. ReadingListController handles web requests for displaying and adding

Listing 5.3. A Groovy test for ReadingListController

Listing 5.4. A Spock specification to test ReadingListController

Chapter 6. Applying Grails in Spring Boot

Listing 6.1. A GORM Book entity

Listing 6.2. A GORM Reader entity

Listing 6.3. A Groovy reading-list controller

Listing 6.4. SecurityConfig in Groovy

Listing 6.5. The reading-list app’s main view written in GSP

Listing 6.6. Fleshing out the ReadingListController

Listing 6.7. A Grails-ready GSP template, including layout

Chapter 7. Taking a peek inside with the Actuator

Listing 7.1. The /beans endpoint exposes the beans in the Spring application context

Listing 7.2. An auto-configuration report for the reading-list app

Listing 7.3. The /env endpoint reports all properties available

Listing 7.4. A configuration properties report

Listing 7.5. The controller/endpoint mappings for the reading-list app

Listing 7.6. The metrics endpoint provides several useful pieces of runtime data

Listing 7.7. The /trace endpoint records web request details

Listing 7.8. The /dump endpoint provides a snapshot of an application’s threads

Listing 7.9. Using injected gauge and counter services

Listing 7.10. Publishing custom metrics

Listing 7.11. Saving trace data to Mongo

Listing 7.12. Defining a custom Amazon health indicator

Listing 7.13. Securing the /shutdown endpoint

Listing 7.14. Adding an in-memory admin authentication user

Chapter 8. Deploying Spring Boot applications

Listing 8.1. Extending SpringBootServletInitializer for the reading-list application

Listing 8.2. A database initialization script for Flyway

Listing 8.3. A Liquibase script for initializing the reading-list database

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset