my blog. for you.

Let’s talk digital.

I’m an independent IT consultant and entrepreneur in the Internet and software business. I’m interested in design, enterprise applications, web apps and SaaS products. I design and develop business solutions and applications. I help companies in terms of software quality and knowledge transfer, e.g. with Angular and Spring Boot.

ArchUnit Spring Integration

ArchUnit is a tremendously useful library for enforcing Java application architecture via unit testing. Fellow software developer and consultant Roland Weisleder recently published a new library called ArchUnit Spring Integration that helps with - well - better integrating ArchUnit with Spring applications. By introducing a DSL, ArchUnit Spring Integration allows you to easily enforce constraints regarding common Spring stereotypes such as @RestController. For example, using ArchUnit Spring Integration you can make sure that methods annotated with @GetMapping (or other HTTP verb mappings, for ... Read more

WireMock Spring Boot

WireMock is an API mocking tool that enables developers to simulate REST APIs during testing. In a system-under-test fashion, it allows us to remove external, potentially flaky, dependencies from our test environment to make our unit tests more focussed and more reliable. WireMock Spring Boot is a new library by consultant and prolific open source contributor Maciej Walkowiak that "drastically simplifies WireMock configuration in a Spring Boot and JUnit 5 application". Featuring a fully declarative WireMock setup and automatic Spring environment setup, ... Read more

Testing with Spring, AOT, GraalVM, and JUnit 5 by Sam Brannen @ Spring I/O 2023

Read more

Things I Wish I Knew When I Started Testing Spring Boot Applications by Philip Riecks @ Spring I/O

Read more

Clearing the Spring Security Context During Unit Testing

Last week I wrote about a minimal Spring Security Context setup for unit testing. I'd like to add just a tiny, yet depending on your use case perhaps quite important, tidbit to that: In case you need to reset a SecurityContext setup, e.g., a mocked user authentication, because, for instance, other test methods from the same unit test class verify behaviour for an unauthenticated application state and hence expect an anonymous user, you can clear the SecurityContext (for example, in your ... Read more

Minimal Spring Security Context Setup for Unit Testing

Creating a minimal Spring Security setup for JUnit unit tests can be a tedious as well as somewhat daunting task. With its Authentication, Principal, GrantedAuthority, and UserDetails classes Spring Security is extremely flexible and configurable and probably accommodates pretty much every authentication and authorization use case under the sun. However, in software architecture such flexibility often comes at price, the trade-off in this case being that simple use cases can require more implementation effort than one would expect. One such use case ... Read more

SCuri: Automating Unit Test Boilerplate Code for Angular Components

As I wrote about quite some time ago in this blog post, which details my solution for managing transitive dependencies for Angular unit tests . although Angular applications in general are easily testable and unit tests are first-class citizens with the framework itself, there's still some potential for improvement when in it comes to test maintainability. In particular, listing and referencing an Angular component's dependencies (i.e. the dependencies of the system under test) such as providers or imported modules can become tedious ... Read more

Revisiting Popular Posts: Spring Batch Resources & Maven Failsafe With Spring Boot

Two of the most popular posts on this blog cover resources for Spring Batch and how to use Maven Failsafe with Spring Boot: Spring Batch Resources: Batch Processing, ETL And Data Conversion Using Maven Failsafe With Spring Boot While doing some regular blog housekeeping, I recently revised those articles and fixed a few broken links. If you're interested in these technologies and frameworks, you might want to check those articles out. Read more

Using Maven Failsafe With Spring Boot

Maven Failsafe is a Maven plugin designed to be used in conjunction with the Maven Surefire Plugin. While the former plugin is intended for running integration tests the latter's purpose is to run unit tests. These plugins are tremendously useful for partitioning tests in Maven-based Java applications in order to make tests and builds run faster. When recently using Maven Failsafe with a Spring Boot application, though, I encountered a somewhat gnarly problem. Running mvn verify caused this error for all of the ... Read more

Testing Spring Boot Applications Masterclass by Philip Riecks

From crafting new software to refactoring existing applications automated testing is an essential part of professional software development and pivotal to high quality software. Philip Riecks (one of the other authors of our upcoming eBook Stratospheric - From Zero to Production with Spring Boot and AWS) offers the - aptly named - Testing Spring Boot Applications Masterclass, a comprehensive, in-depth online course on testing Spring Boot Applications. Currently (as of September 2020), the course consists of more than 90 videos (six hours in ... Read more
Next Page »