Java Inheritance: A Beginner’s Guide
Output: Brand is: Ford This is a Ford with a number of seats 5 and with colour blue
Read More Java Inheritance: A Beginner’s GuideOutput: Brand is: Ford This is a Ford with a number of seats 5 and with colour blue
Read More Java Inheritance: A Beginner’s GuideThis Spring Data JPA tutorial will demonstrate how to use the LIKE % expression in a Native SQL Query. In an advanced SQL LIKE expression, the % sign represents zero, one, or multiple characters within the SQL query. Let’s take a look at a Native JPA SQL Query that employs an advanced SQL LIKE expression…
Read More LIKE % Expression in JPA SQL QueriesThis 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: RestAssuredConvert char to String in Java using the String.valueOf() method There is a valueOf() static method in the String class that returns the String representation of its argument, which can be a char or any other data type. public class Test { public static void main(String[] args) { char ch = ‘a’; String str =…
Read More Convert Char to String in JavaIn 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 @DeleteMappingIn this Spring Boot Security tutorial, you will learn how to use Spring method-level security to secure RestController methods with @PreAuthorize annotation. If you are interested in video lessons, then I also show how to create user Roles and Authorities and how to use Spring Method Level Security annotations in my video course: RESTful Web…
Read More Spring Method-Level Security with @PreAuthorizeIn previous video tutorials, I have shared with you how to read Request Path parameters, Query String parameters, and Form data. In this tutorial, you will learn how to read JSON from HTTP Post request body in Spring Boot application. To read the body of an HTTP Post request, we will use the @RequestBody annotation…
Read More Reading JSON in Spring with @RequestBodyThis tutorial will teach you how to retrieve URI path variables in your Spring MVC web application. Define Path Variable To define a path variable in the URI path, we use curly brackets. For example, the @GetMapping annotation below specifies one path variable called userId, which is surrounded by curly brackets. @GetMapping(path=”/users/{userId}”) @PathVariable Annotation To…
Read More Spring MVC: Reading URI Path VariablesIf you ever worked with datasets there is mostly a need to get specific information about that whole data. If you use python and handle data with pandas, then filtering data is quite easy. In order to select rows based on column values, in a DataFrame there are many different ways in Pandas. In this…
Read More Pandas: How to Select Rows Based on Column ValuesIn this tutorial, I will show you how to add support for the H2 in-memory database to your Spring Boot project with Spring Security enabled. By the end of this tutorial, you will be able to watch a video demonstration of how to implement it. After following the steps below, your Spring Boot project will…
Read More Add H2 Database to Spring Boot with Spring Security: A GuideThis tutorial will guide you on how to incorporate JUnit support into your Spring Boot application based on Maven. Spring Boot Starter Test Dependency To add JUnit and Mockito support to your Maven-based Spring Boot application, include the following dependencies in the <dependencies> section of your pom.xml file: <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> By adding…
Read More JUnit Support in Spring BootIn the software development process, testing is essential. There are two types of testing i.e. unit testing and integration testing. While unit testing focuses on testing the smallest component of an application, integration testing focuses on testing the end-to-end behavior of the application also known as endpoint testing. Integration testing verifies the @Controller and @RestController…
Read More Testing Spring Boot Applications with MockMvcThis tutorial guides you through writing type-safe queries in Java using jOOQ (Java Object Oriented Query). You’ll get a quick tour of jOOQ by running an application and seeing how it generates database tables from Java classes. With its smooth API, jOOQ also helps you create type-safe SQL queries. jOOQ vs JPA jOOQ is a…
Read More Type Safe SQL Queries in Java with jOOQIn this tutorial, we will generate a random alpha-numeric string of characters, which can be used as a user password. Password Requirements When generating passwords, it’s important to set requirements that make them strong and difficult to guess. Here are some guidelines to follow when creating password requirements: Length The length of a password is…
Read More Generate Secure Password in JavaA test suite is a collection of test cases that are run together as a single unit. It helps to organize and manage the execution of multiple test cases. Test suites can be used to group related tests or to test different aspects of a complex system. They can also be used to run tests…
Read More JUnit 5 Test Suite Tutorial