
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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