RESTful Web Services

This tutorial covers three distinct methods for reading application properties in a Spring Boot application. These methods include: Using the Environment object. Using the @ConfigurationProperties annotation. Using the @Value annotation. I made a simple Spring Boot Web App to show you how to read application properties. You can use the tutorial Create a Simple Web…

Read More Spring Boot: Reading Application Properties

In this REST Assured tutorial, I will demonstrate how to evaluate the JSON content that is returned in the response body of an HTTP response. What is REST Assured? REST Assured is a Java-based library for testing RESTful web services. It provides a domain-specific language (DSL) for writing tests that interact with web services using…

Read More Validate JSON Response with REST Assured

This short REST Assured tutorial will teach you how to validate the HTTP Response Status Code while testing a RESTful Web Service endpoint. Each HTTP Response includes a status code, and by examining the status code value, we can determine if the HTTP Response was successful or not. Let’s explore how we can use REST…

Read More Validate HTTP Status Code: RestAssured

In this blog post, I will share the Spring annotations used to map HTTP requests to specific handler methods. These annotations include @PostMapping, @GetMapping, @PutMapping, and @DeleteMapping. While most Spring Boot applications use the @RequestMapping annotation, which I will also cover in this post, I’ll begin with the newer shortcut annotations that have been available…

Read More Spring Annotations @PostMapping, @GetMapping, @PutMapping and @DeleteMapping

In this Spring Security tutorial, you will learn how to enable and use the Method Level Security with a @Secured annotation. @Secured is a Spring Security annotation used to specify that a method should be executed only if the authenticated user has the required roles or authorities. When you use this annotation, you can specify…

Read More Spring Security @Secured: Method-Level Protection

This tutorial will teach you how to add Spring Security to your project and enable in-memory basic authentication. You will learn how to configure two different users with different Roles and Privileges. Both users’ roles and privileges will be stored in the memory of your Spring Boot application. If you use Spring Framework and OAuth,…

Read More Spring Security In-Memory Authentication

In this Spring Security tutorial, you will learn how to enable Basic Authentication for your Spring Boot project and configure the default username, password and user role. You will also learn how to secure a web service request URL so only authenticated users with a default username, password and role can access it. If you use…

Read More Spring Security Default Username, Password, Role

An important property of modern web apps is resilience. In simple terms, resilience refers to the ability of a system or feature to fail gracefully without impacting the entire system. In the context of web apps, we want to ensure that the entire system will not go down if a remote service, such as a…

Read More Enforcing Resilience in Spring Boot with Resilience4J