AWS Lambda is a great technology to get your code up and running in a matter of minutes. I’m heavily using AWS Lambda for various automation and marketing tasks for this blog and my online courses. I recently gave Spring Cloud Function with Kotlin for AWS Lambda a try. It’s a powerful combination if you’re
Learning how to test a Spring Boot application effectively can be a hurdle, especially for newcomers. Without a basic knowledge of Spring’s dependency injection mechanism and what Spring Boot’s auto-configuration is all about, we might end up throwing annotations to our test. Trying to make things work. While this trial and error might fix the
I’ve seen a lot of confusion recently about the SpringExtension. When failing to get the context configuration for a test right, some developers randomly throw @ExtendWith(SpringExtension.class) to their test classes to (hopefully) get their tests running. With this blog post, I want to shed some light on the SpringExtension and its usage when testing Spring
With this guide, we’ll investigate the powerful @SpringBootTest annotation for writing Spring Boot integration tests. If you’re new to testing the Spring Boot applications, start with the testing overview and get a basic understanding of the testing swiss-army knife Spring Boot Starter Test. While the Spring ecosystem seamlessly integrates various technologies and tools, it also
With this blog, you’ll get an overview of how unit and integration testing works with Spring Boot. On top of this, you’ll learn what Spring features and libraries to focus on first. This article acts as an aggregator and at several places, you’ll find links to other articles and guides that explain the concepts in
With one of the previous blog posts, we configured a Thymeleaf Spring Boot application for an OAuth 2 Login with Spring Security and AWS Cognito. While this article focussed on the setup and login mechanism, the logout functionality was only half-way implemented. Our end-users are still logged in at the identity provider. Let’s adjust the
One of the core features of Spring is the event publishing functionality. We can use events to decouple parts of our application and implement a publish-subscribe pattern. One part of our application can publish an event that multiple listeners (even asynchronously) react to. As part of Spring Framework 5.3.3 (Spring Boot 2.4.2), we can now
REST Assured is a Java DSL (Domain Specific Langauge) that aims to simplify testing REST APIs. It follows a BDD (Behavior Driven Development) approach and is influenced by testing APIs with dynamic languages like Groovy. We can use REST Assured to test the REST API of any Java project as it is framework independent. However,
As soon as you scale out your Spring Boot application (run with multiple instances) to e.g. increase throughput or availability, you have to ensure your application is ready for this architecture. Some parts of an application require tweaks before they fit for such an architecture. The use of @Scheduled tasks is a candidate for this.
MongoDB is one of the NoSQL databases that Spring Boot offers great testing support for. Like all other test slice annotations from Spring Boot, when using @DataMongoTest, we’ll get a Spring Test Context with just enough beans to test any MongoDB-related code. By default, Spring Boot tries to start and use an embedded MongoDB instance.