Chapter 1: Introduction to API Testing
What Is API Testing?
Need
Types of API Testing
Advantages
Summary
Chapter 2: Web Application Architecture
Web Applications Defined
Monolithic vs. Microservices Architecture
Designing Test Strategies
RESTful Architecture
HTTP
Headers
Requests
Request Methods
Resource Addresses
Request Headers
Request Body
Response
Status Line
Response Header
Response Body
Response Codes
Summary
Chapter 3: Authentication
HTTP Authentication
Basic Authentication
Session-Based Authentication
Token/JWT-Based Authentication
OAuth2-Based Authentication
Authorization
RBAC
ABAC
Authentication and Authorization Services
Summary
Chapter 4: Tools, Frameworks, and Libraries
API Testing Tools
cURL
Postman
RestAssured
Frameworks/Libraries
TestNG
Log4j
Jackson-Databind
HashMap
,Assertj
Java Spring
Summary
Chapter 5: Test Pyramid
Black Box Testing
Grey Box Testing
White Box Testing
Test Pyramid
Summary
Chapter 6: Testing the API
Workflows/Use Cases/Test Script
Schema Validation
Test Coverage
Header Testing
Request Header
Response Header
Request Body
Format Unsupported
Special Characters
Very Long Strings
Invalid Method
Invalid Value
Incorrect Data Type
Empty Data/Object
Required Fields
Null
Redundant Fields
DELETE Already Deleted Entity
Duplicate Check
Response Body
Actual Data vs. Expected Data
Limit/Size/Pagination/Sorting
API Version Testing
Internal vs. External APIs
Consumer-Driven Contract Testing
Importance of Negative Testing
Summary
Chapter 7: A Good Test Script
Components of a Test Script
setup( )
test( )
teardown( )
Guidelines
Single-Attempt Test
Document Test Objective
Keep It Small
, Use assertj for Assertions
Use log4j
Order of Tests
No Interventions Between Test Steps
Avoid Hard Sleeps
Always Use Assertions
Do Not Overtest
Do Not Import a Test into Another Test
Test Boundaries
API Test Coverage
Provide Short Commands
Do not try{} catch{}
Summary
Chapter 8: Coding Guidelines
Coding Best Practices
Class Naming Conventions
Method Naming Conventions
Variable Naming Conventions
Constant Naming Conventions
Provide User Actions
Simplicity
Indentation
Test Assertions
Test Class Naming Conventions
Test Method Naming Conventions
Test Package Naming Conventions
Documentation
Summary
Chapter 9: Organize a Test Framework
Framework Requirements
Request
Response
Exception
Configuration
User Authentication
Processor
Model
Test Framework
Test Assertions
Logger
Util
Test Execution
Debug Config
Test Driver
Setting Up a Maven Project
Dependencies and Plugins