
Explore the basics of rest web services, their advantages, and how to validate outputs using Postman. Build and optimize a Maven-based framework to test rest APIs with authentication and https.
Identify the prerequisite concepts for this course, including basic Java knowledge, classes and objects, and Eclipse setup. Learn to create a project, run Java applications, and understand syntax before starting.
Identify the essential tools for this course: JDK 1.8, Tomcat 8.0, Eclipse Lunar, and the Postman Chrome extension, with versions aligned to the presentation.
Learn to set up JDK 1.8 on your local system by downloading the 64-bit installer, installing, configuring JAVA_HOME, updating PATH, and validating with java -version and javac -version.
Download and install Apache Tomcat 8.0.39 as a service, configure the Java path and credentials, start Tomcat on port 8080, and use the manager to deploy restful web services.
Set up Eclipse, download Lunar IDE with Maven integration, unzip, launch Eclipse, and create a Java project with a workspace to run a test application.
Set up the Postman client as a Chrome extension to test web services, then verify installation by sending a get request to google.com and receiving a proper response.
Setting up the environment using virtual machine. which have all the tools and project setup required for this course
Define a web service as a function or container accessible by another program over the web, enabling a client to request resources from a server in a client-server architecture.
Understand rest as an architectural style using http for lightweight web services, developed to overcome soap limitations, with resources represented in text, json, or xml by restful APIs.
Understand the request and response format, including method, headers, and body, and authentication details in headers. Interpret standard http status codes to assess success or failure.
Deploy the test application in Tomcat by deploying its war file and starting the Tomcat service, then verify deployment via the manager app console and a Postman get request.
Test the laptop bag application, a restful container for laptop details (name, id, feature, brand) exposed via get, post, put, and delete endpoints, with status checks and retrieval by id.
Test rest endpoints for ping, list all laptops, and find by id using Postman, validating response presence, status codes, and content at progressive levels.
Test the delete endpoint by removing a valid id, receiving a 200 with the id, and after deletion confirm 404 not found for that id.
Set up maven on your system by downloading the binaries, extracting the zip, creating the MVN_HOME variable, updating the path to include bin, and verifying with mvn -version.
Create a Maven project to auto-manage dependencies and packaging, configure pom.xml with JUnit and HttpClient, and build a ready-to-ship jar via Maven install.
Add the Apache HttpClient dependency to the pom.xml and learn to create a client, set headers, execute requests, and print responses to the console.
Create a HttpGet request, build a ClosableHttpClient via HttpClientBuilder, and execute the request to the ping endpoint to retrieve and print the response.
Understand how to implement a get request with CloseableHttpClient and CloseableHttpResponse, using Java 8 try-with-resources for automatic resource closing and cleaner code.
Design a reusable framework method for handling get requests using rest client code, modeling response with status code and body, and returning a rest response for further validation.
Create an overloaded get method that accepts a Uri object and delegates to the string version. Add Maven JUnit tests to validate the ping endpoint's status and response body.
Extend the junit tests for the get endpoints, including listing all details and fetching a laptop detail by id, and adapt the framework to gracefully handle http response exceptions. Improve status code handling for responses above 300 by returning a model with the same status and a meaningful message.
Add headers to http get requests using a header map, support single or multiple headers, handle null headers gracefully, and ensure json output by setting the accept header.
Learn to perform level two validation by deserializing a JSON response into a mapper class, then verify fields like brand name, id, and laptop name.
Learn to create and execute http post requests with Apache HttpClient, including setting content-type headers and json payloads, and parsing the response.
Post json data from a file by using a file entity, reading the file content, and binding it to a post request with content type application/json.
Develop a framework post method in the rest api helper to send a json payload with headers, using http post, handle response, and return status code via a response handler.
Generalize the post request method to support different entity types by passing content as an object and a content type, returning a string or file HttpEntity.
Optimize get and post requests by extracting common header handling into a shared getCustomHeaders method. Implement a generic performRequest that executes HttpGet or HttpPost, enabling reusable, header-aware request execution.
Create a delete request using the request builder, build an Http delete, execute with a closeable Http client, and verify a 404 after removal.
Write a unit test for the delete method by posting data, deleting it via the delete endpoint, and validating with a get request that the item returns 404 not found.
Update laptop details using the http put method with a request builder, set headers for json and xml, send an xml body, and handle the xml response.
Create a put method in the rest API helper that uses a request builder to build a put request with a Uri, content, type, adds headers, and returns the response.
Write a JUnit test for the HTTP PUT method by creating a record via POST, updating it, and validating with GET for a 200 status and XML content.
Upload files over HTTP using multipart form data with MultipartEntityBuilder by attaching a binary body (parameter name, file, content type, and file name) and building the STP entity.
Write a unit test for the file upload endpoint using a post request with multipart form data, validating the response and confirming the uploaded file appears in the temporary directory.
Explain how basic authentication lets a client access server resources by sending encrypted username and password, which the server decrypts and validates to grant or deny access.
Discover how secure endpoints require basic authentication, demonstrate context path changes, and test protected resources to handle 401 unauthorized responses, using RestAssured and Apache HttpClient.
Demonstrate basic authentication with Postman by configuring the authorization tab, providing admin and welcome, encoding credentials in base64, and sending requests to access secure endpoints.
Learn how to perform authorization from code by adding headers to each request, including accept and authorization, and encode credentials with base64 to access secure endpoints.
Generate a self-signed ssl certificate using the JDK, import it into Tomcat, and enable ssl in server.xml to secure endpoints; deploy ssl-enabled wars and test https access.
Learn to configure an SSL context with a trust strategy to bypass certificate verification and use it to send a GET request to an SSL secured endpoint.
Develop framework methods for SSL-secured get and post requests, constructing HTTP entities and applying headers. Use a private perform request helper to centralize execution and handle errors with custom headers.
Write a JUnit test that posts JSON to an HTTPS endpoint, validates the status, then gets by ID, deserializes the JSON, and asserts the ID and laptop name.
Develop a framework method for put and delete with ssl in the https client helper. Build requests with content, content type, and headers, and expose overloads.
Write JUnit tests for put and delete endpoints with ssl, posting data, retrieving by id, updating via put, deleting, and validating 200 and 404 status codes and updated content.
Create an http async client with the http async client builder, handling ssl context and custom headers, including adding dependencies, and enabling ssl verification override for secure requests.
Learn how the future callback interface monitors the status of Http async requests using HttpResponse as the type, implementing completed, failed, and canceled methods to track outcomes.
Write a JUnit test using the HTTP asynchronous client to post, get, update, and delete laptop details in a container, validating each step with subsequent GET requests.
RESTful Web Services are REST architecture based web services. In REST Architecture everything is a resource. RESTful web services are light weight, highly scalable and maintainable and are very commonly used to create APIs for web based applications.
This course will teach you about the testing of Restful Web Services. In this course everything is taught from scratch.
In the first section, I am going to discuss about the basic of restful web services and required concept for this course.
In the next section, we will start with manual testing part of restful web services using Postman client. Which will give you more detail understanding about what we should test. This includes
In the next section, I will start with the automation part, discussing about Apache HttpClient library. This includes
By the end of this course, you will have great understanding of restful service and how to automate them using Apache HttpClient library
The course is not limited to following content. In future I will keep adding the new topics to this course.
And source code shown as part of video lecture will be provided for download