Learn how to use Logback’s ListAppender to collect log messages and use the LoggingEvent to check for a simple message.
Also find me here:
Baeldung Author
Roger Yates
I’m a certified Java Enterprise Architect with over 20 years of Java server-side development experience, mainly in the financial and travel industries. Most recently using Spring Boot for REST API development and am an avid fan of the Spock testing framework.
Here's what I've written (so far):
Baeldung on Java
- All
- Testing (5)
- Spring Boot (2)
- Java (2)
- Groovy (2)
- Spring Security (1)
- Maven (1)
- Logging (1)
- Java IO (1)
- JVM (1)
- HTTP Client-Side (1)
Reducing Duplication With Spock’s Helper Methods
Filed under Testing
Learn to use Spock’s with() and verifyAll() helper methods to reduce the boilerplate in your tests when comparing objects.
Injecting a Mock as a Spring Bean in a Spock Spring Test
Learn how to stub Spring-managed dependencies using Spock’s @StubBeans annotation.
Capturing Method Arguments When Running Spock Tests
Learn how to capture method arguments using Spock’s Stubs, Mocks, and Spies using Closures.
Improving Test Coverage and Readability With Spock’s Data Pipes and Tables
Filed under Testing
Learn how to use Spock’s data feeds in a where block.
Java HttpClient Connection Management
Filed under HTTP Client-Side
Learn how the Java HttpClient reuses connections from its internal connection pool.
Using @NotNull on a Method Parameter
Filed under Spring Boot
A guide to using @NotNull on method parameters.
Spring @EnableWebSecurity vs. @EnableGlobalMethodSecurity
Filed under Spring Boot, Spring Security
Spring Security in Spring Boot allows a couple of different approaches for setting access rights for our endpoints. We explore both the standard web security module and the JSR–250 approach here.
The java.security.egd JVM Option
Filed under JVM
The java.security.egd JVM startup property affects how the SecureRandom class initializes. Let’s explore how changing its value impacts our code.