Categories
Java

Generate and sign messages with RSA in Java

RSA stands for Rivest Shamir Adleman. It is one of the oldest yet most widely used. RSA is a public-key cryptosystem that is suitable for transmitting data securely. In this article, we cover how to generate and sign messages with RSA in Java. How RSA works When generating an RSA, a key pair is generated, […]

Categories
Java

Mockito return based on the input parameter

Mockito, the defacto mocking library in the Java world that is widely adopted. It is used one way or another by almost any Java project. Mockito is known for its versatility which offers powerful features for dynamic testing scenarios. In this article, we discuss how to return a result of a mock object based on […]

Categories
Java

Pass null values in JUnit 5 @CsvSource

JUnit 5 @CsvSource allows writing parameterized tests without creating a CSV file or writing a method to feed data. However, handling nulls is not provided out of the box and requires a bit of configuration. In this article, we cover how to pass null values in JUnit 5 @CsvSource annotation. Let’s start by writing a […]

Categories
Spring

Change Spring Boot log level at runtime with actuator

Spring Boot actuator allows changing an application log at runtime at a granular level. In this article, we cover how to change a Spring Boot application log level at runtime with the actuator endpoint. The prerequisite for changing the log level at runtime is to expose the logger actuator. We do that by adding the […]

Categories
Kubernetes Spring

Remote debug a Spring Boot application in Kubernetes

Sometimes, debugging an application locally is insufficient to pinpoint the underlying issue. Additionally, there are times when the infrastructure limitations do not allow one to debug an application. In such scenarios, remote debugging is a reasonable approach. However, that requires some preparations. In this article, we cover how to remote debug a Spring Boot application […]

Categories
Java Kotlin Spring

Spring Boot Swagger documentation using OpenAPI

Rich API documentation is a vital element of any successful project, especially if it has to be integrated by third parties. Unfortunately, Spring Boot does not have an out-of-the-box solution for Swagger documentation. So we must use a third-party library (Springdoc-openapi) for that purpose. In this article, we cover how to add Spring Boot Swagger […]

Exit mobile version