File Upload and File Download REST APIs Testing using Rest Assured in Java
Introduction In this tutorial I will show you how to test REST APIs used for file upload and file download. The file upload or download application might have been created using any server side technology. I am going to use here Rest Assured library with Junit 5 framework in Java programming language. I will use multipart for file upload test….
How to perform CRUD operations REST API testing using Rest Assured in Java
Introduction In this example we will see how to perform CRUD operations REST API testing using Rest Assured library in Java programming language. Testing and validating REST services in Java is harder than in dynamic languages such as Ruby and Groovy. REST Assured brings the simplicity of using these languages into the Java domain. This tutorial will show you how…
How to work with IN, OUT and INOUT Parameters in Stored Procedures using Spring Data JPA
Introduction In this tutorial I will show you how to work with IN, OUT and INOUT parameters in Stored Procedure using Spring Data JPA. I will also call a stored procedure having no parameter at all. I am going to use MySQL server, so there may be some limitations on MySQL server or there may be some limitations on Spring…
Find Closest Number from Array to the Given Number in Java
In this tutorial you will find closest number from array to the given number. Given an array of sorted integers, find the closest value to the given number. The array may contain duplicate values and negative numbers. Examples Array : 2,5,6,7,8,8,9Target number : 5Output : 5
How to check or make a number palindrome in Java
Here we will create an example on how to check a given number is palindrome or not. We will also make the given number palindrome if it is not palindrome. In our other tutorial we have seen how to check a string is palindrome or not. A string or number is palindrome if it is equal to its reversed counterpart….
How to read, write and compress text file in Python
In this tutorial we will create examples how to read text file and gzip file. We will also create a text file and compress or gzip file. The gzip file or compressed file extension is gz. Prerequisites Python 3.8.1 Import Module Import required module as a first step in the Python script. Read File The below function read either compressed…
Server Sent Events with CodeIgniter – Push Notifications
Introduction In this tutorial we will create an example on server sent events (SSE) with CodeIgniter – push notifications. Sometimes we face situations, where the application needs only one way communication, i.e., sending data from server to the client and for this Spring provides a simpler solution using Server Sent Events (SSE). SSE is a technology that allows you to…
How to map Custom Query Results into DTO in Spring Data JPA
Introduction In this tutorial I will show you how to map custom query results into DTO in Spring Data JPA. Situations may occur while you are unable to return the entity object(s) as results from your Spring Data JPA Repository and instead you need to write custom query or native query for your business requirements. So in such situations you…
Documenting REST APIs With Open API And Spring Boot
REST API Documentation This tutorial will show you an example on how to document REST APIs using OpenAPI 3. When creating a REST API, good documentation is instrumental. Here I will use OpenAPI 3 in Spring application for creating documentation for REST APIs. I will create and deploy REST services but I do not have an option to let others…
PHP REST API Authentication Using JWT
Introduction Here in this tutorial, PHP REST API authentication using JWT, you will see how to use JWT (JSON Web Token) to authorize users and allow them to continue their works once they are logged in using their regular credentials (usernames and passwords). Users use their credentials to get the JWTs and continue their work until JWTs expire. In this…