How to fix Failed to load ApplicationContext
in Spring (Boot) applications (6 mins read).

Some common issues with Spring dependency injection and how to fix them.
How to fix Failed to load ApplicationContext
in Spring (Boot) applications (6 mins read).
Some common issues with Spring dependency injection and how to fix them.
Converting an x5c
from a JSON Web Key to a PEM with Node.JS (1 mins read).
How to convert a JWK's x5c
to a PEM-formatted certificate with Node.JS.
Extracting x5c
s from a JSON Web Key Set (JWKS) to PEM files with Node.js (1 mins read).
How to extract the full chain of certificates from a JWKS' x5c
parameter to files.
Generate a running mock server from an OpenAPI specification using Prism (3 mins read).
Using Stoplight's prism
tool to run a stubbed server from an OpenAPI specification, for better testing.
Gotcha: checked and unchecked exception handling from Spring WebFlux WebClient
(2 mins read).
How checked and unchecked exceptions may appear when testing your WebClient
code.
Accessing the response body with Spring WebFlux WebClient
with onStatus
(1 mins read).
How to access the body of an (error) response when using WebClient
's onStatus
method.
Running a command on a visual selection in Vim (1 mins read).
How to pipe the text in a visual selection to a command, either to run it, or to replace the text in the seletion.
Updating the CA Certificate bundle in Chef Installations (3 mins read).
How to update/add new certificates to the Certificate Authority Certificate Bundle in a Chef Development Kit / Workstation installation.
Automagically formatting on save, with Neovim and Language Server Protocol (LSP) (1 mins read).
How to use Neovim's Language Server Protocol (LSP) support to autoformat code on a file's save.
Gotcha: Segfault when HTTP headers include newlines with Go (2 mins read).
Why you may be receiving a segfault when using http.Client
with HTTTP headers that include newlines.
Converting Spring Boot Property Variables to Environment Variables with Go (1 mins read).
A command-line script to convert a Spring Boot property to an environment variable.
Pretty Printing JSON Web Tokens (JWTs) on the Command Line using Go (2 mins read).
How to easily introspect and pretty print a signed JWT (JWS) or an encrypted JWT (JWE) on the command line using Go.
Gotcha: Field casing is important when marshalling struct
s to JSON in Go (2 mins read).
Why you may be missing fields from your struct
s in your Go json.Marshal
calls.
Testing @Scheduled
annotations with Spring (Boot) (2 mins read).
How to test your Spring (Boot) scheduling without waiting for hours.
Pretty Printing JSON on the Command Line with Go (1 mins read).
Using Go's JSON module to pretty print JSON objects from the command line.
Reading all of stdin
on the command-line with Go (1 mins read).
How to read the whole of stdin
, up to EOF, with Go.
Exporting a Git repo as an archive (1 mins read).
How to export a Git repo as an archive format, such as a .tar.gz
or a .zip
.
How to interpolate a property inside Spring Security @PreAuthorize
/ @PostAuthorize
(3 mins read).
How to use the value of a property in a Spring Security authorization statement.
Combining an Audio-only and Video-only MP4 with ffmpeg
on the command-line (1 mins read).
How to use ffmpeg
to combine two MP4 files, where each file contains audio and video separately.
Adding a Wiretap to a Spring WebFlux WebClient
to Log All Request/Response Data (2 mins read).
How to log all request/response data from a Spring Webflux WebClient
.
Determining if the Spring Boot Application is Running in Debug or Trace Mode (3 mins read).
How to determine if your Spring Boot application is running in debug mode, for instance to selectively enable other features of your application.
Simplifying Spring (Boot) ExceptionHandler
s by extending ResponseStatusException
(1 mins read).
How to drive HTTP response status codes from exceptions by extending Spring's ResponseStatusException
.
Bundling Multi-File OpenAPI Documents into a Single File (2 mins read).
Looking at the options we have for converting a multi-file OpenAPI specification to a single document.
Generating Favicons using ImageMagick on the Command-Line (1 mins read).
How to generate a multi-size favicon.ico
on the command-line using ImageMagick.
Excluding Filter
s When using WebMvcTest
(1 mins read).
How to exclude specific Filter
s from running when performing WebMvcTest
s.
Capturing HTTP Requests with okhttp's MockWebServer.takeRequest
(1 mins read).
How to use MockWebServer
's takeRequest
method to verify that HTTP request(s) are sent correctly.
Integration Testing Your Spring WebClient
s with okhttp's MockWebServer
(5 mins read).
How to write integration tests using MockWebServer
with Spring Boot, for use with WebClient
s.
Generate Plain Old Java Objects (POJOs) from OpenAPI Model Definitions with Gradle (2 mins read).
How to generate POJOs really quickly and easily, with no manual work, using the Gradle openapi-generator Plugin.
Running Elements API Viewer to Verify Local OpenAPI/Swagger Documents (2 mins read).
How to run Elements UI locally to visualise OpenAPI documents.
I don't think you should be logging that? π³ (12 mins read).
Common pitfalls and dangerous things that you should be watching out for in your log messages.
Validating a MockMvc
Response Has No Content Type (1 mins read).
How to validate, in a MockMvc
test, whether the response has no content-type
nor a body.
Replacing Text in Vim with the Output of a Command (1 mins read).
How to replace text under the cursor with the output of a command.
Integration Testing Your Spring RestTemplate
s with RestClientTest
, using spring-test (8 mins read).
How to write integration tests using RestClientTest
with Spring Boot, for use with RestTemplate
and RestTemplateBuilder
s.
Running Swagger UI to Verify Local OpenAPI/Swagger Documents (2 mins read).
How to run Swagger UI locally to visualise OpenAPI documents.
Getting Started with jMolecules and the (Classical) Onion Architecture, with a Spring Boot project (6 mins read).
A guided example of converting a Spring Boot project to the Onion Architecture pattern.
How to Create and Unit Test Java Bean Validation Annotations (12 mins read).
A guided example through what the different type of annotation ElementType
s are, with respect to Bean Validation, and how to write unit tests for them.
Codifying Your Technical / Architectural Standards with ArchUnit (7 mins read).
How to use ArchUnit to codify your technical standards to reduce code review requirements, and arrive at a more consistent codebase.
Appending to a Querystring using Go (1 mins read).
How to append query parameters in a URL in Go.
Simplifying Spring (Boot) ExceptionHandler
s with ResponseStatus
Annotations (2 mins read).
How to use annotations to drive HTTP response codes from a Spring ExceptionHandler
.
Mocking void
methods with Mockito (1 mins read).
How to Mock a void
method with Mockito, for instance to throw an exception.
Content Negotiation with Servlet Filter
in Spring (Boot) (3 mins read).
How to perform content-negotiation in a Servlet Filter
, to serve the correct representation of error to a consumer, based on the Accept
header.
Content Negotiation with ControllerAdvice
and ExceptionHandler
s in Spring (Boot) (5 mins read).
How to perform content-negotiation in a Spring ExceptionHandler
, to serve the correct representation of error to a consumer, based on the Accept
header.
Error Handling in (Spring) Servlet Filters (2 mins read).
How to return HTTP errors when a Java Servlet fails with Spring (Boot).
Validating UUIDs with Regular Expressions in Java (1 mins read).
How to validate UUIDs and UUIDv4s in Java with a regex.
Auditing with Spring Boot Actuator (9 mins read).
How to use Spring Boot Actuator for your audit and business event logging needs.
Returning a Value, or a Default, From a Java Optional
(1 mins read).
How to replace imperative code with a functional style, when returning a default value for a Java Optional
.
Adding both an ObjectMapper
and a YAMLMapper
to Spring Boot (2 mins read).
How to have an ObjectMapper
and a YAMLMapper
coexisting in a Spring Boot project's bean dependencies.
Testing Data Serialisation/Deserialization in Java (with Gson) (3 mins read).
How to validate your JSON types correctly serialise/deserialise when using the Gson library.
Improving Life-Work Balance on GitHub using per-Organisation Notification Settings (2 mins read).
How to set up per-organisation notification settings so your personal email doesn't get work-related notifications.
Publishing to Maven Repositories with GitLab CI, with Signed Artefacts (4 mins read).
How to publish signed artefacts from a Gradle build to Maven repositories (such as Maven Central) when using GitLab CI.