In this blog post, we’ll explore how Spring Security handles authorization. The first part concentrates on web security and the integration with Spring Web MVC. In the second part, we’ll have a look at method security and the integration with Spring AOP.
[Read More]Exploring Spring Security's Authentication Mechanism in Web Applications
In this blog post, we’ll take a deep dive into Spring Security’s authentication mechanism and how it integrates with Spring Web MVC. Using a JWT as an example, we will explore the main classes in the Spring Security authentication mechanism and how they work together.
[Read More]How to test FTP file exchanges with MockFtpServer
An application running in complete isolation is quite rare these days. Often, they integrate with other services to increase the value they deliver. When dealing with legacy applications, I often see the pattern of file transmission via FTP. Because the correct and stable integration of services can be an important part of business it should be tested properly.
In this blog post, I will show you how you can test the file transmission via FTP with MockFtpServer.
How to test the composition of Spring Data Specifications
In my blog post ‘How to use Spring Data’s Specification’ I showed you how you can write automated tests for your Spring Data Specifications. Although it explained how you can test a single specification, it missed a crucial part. The testing of composite specifications. In this follow-up post, I will close the gap left last time.
[Read More]How to use Spring Data's Specification
The query methods of Spring Data JPA are a convenient way to retrieve data from your database. By simply defining methods in an interface, the framework can derive queries. For more complicated things, you can also define named queries and write your own JPQL or native SQL queries. However, with a growing application, this approach shows its drawbacks. New use-cases require new, but only slightly different, queries. The results are growing repositories that become harder and harder to maintain.
In this blog post, I’ll show you how to use Spring Data’s Specification
to address this problem.
How to test any HTTP Client of your Spring Boot Application with MockServer
In an integration test, we want to test the interaction of several components of our application. However, as soon as one of these components communicates with a 3rd party service via HTTP, this can present us with a challenge. To be independent of this service, we have to mock it. In this blog post, I will show you how to do that with the help of MockServer.
[Read More]How To Improve JUnit DisplayNames With The New 'Named' API
Testcontainers – How to use them in your Spring Boot Integration Tests
How to test the Web Services of your Spring Boot Application with @WebServiceServerTest
The idea of applications that provide their services over the web is anything but new. Chances are quite high that you already implemented such a service through a REST API. But before REST, there was a different approach to providing such services - SOAP. The release of Spring Boot 2.6.0 introduced a new test slice to test the components involved in providing these services. Let’s have a look at it!
[Read More]How to test the Services of your Spring Boot Application
In this Blogpost, I’ll show you how to test the business logic inside your service classes. In the example, we will implement some plain Unit Tests. I will also discuss the downsides of this approach and why I prefer it over Integration Tests nonetheless.
[Read More]