Framework Design: Q&A
- How did a real interview experience inspire this framework?
- A: After an interview where I struggled with object mapping in Rest Assured and TestNG, I rebuilt
the
framework to focus on modular design, robust data modeling, and reusable utilities. This led to the
creation of classes like
JsonUtils.java
for parsing and mapping API responses efficiently. - What led me to explore Amadeus APIs for this project?
- A: My interest in Amadeus APIs was sparked by an airline domain interview. I developed record
classes
such as
AirportQueriesWrapper.java
andLocation.java
to model API data, and usedJsonUtils.java
for seamless JSON handling, ensuring the framework could adapt to various travel-related endpoints. - What core design values shaped my approach?
- A: The framework emphasizes modularity, reusability, and maintainability. Data models are defined
using Java records, while utilities like
RestAssuredLoggerFilter.java
andTokenManager.java
provide centralized logging and authentication. The package-by-feature structure keeps the codebase organized and scalable. - How did I implement custom logging?
- A: Custom logging is achieved via
RestAssuredLoggerFilter.java
, which logs request methods, URIs, headers, and bodies at different log levels. It integrates with Log4j2 for flexible log management and stores status codes for retry analysis, making debugging and traceability straightforward. - What challenges did I face with API rate limits, and how did I solve them?
- A: Frequent 429 errors during fast test runs were solved by implementing a retry mechanism using
RetryAnalyzer.java
andAnnotationTransformer.java
. The framework checks response status codes and automatically retries failed tests, improving reliability in CI/CD pipelines. - How did I ensure API credentials and secrets are secure?
- A: Credentials are encrypted using AES-256 in
EncryptionUtils.java
and decrypted at runtime viaReadProperties.java
. The encryption key is stored as an environment variable, ensuring sensitive data is never exposed in source code or config files. - How does the TokenManager work and maintain thread safety?
- A:
TokenManager.java
manages OAuth2 tokens with caching and expiry detection. It uses synchronized blocks to ensure thread safety during parallel test execution, refreshing tokens before expiry and isolating authentication logic from global Rest Assured specifications. - How does the framework support parallel test execution?
- A: Parallel execution is enabled via TestNG configuration (
testng.xml
), with thread-safe token sharing and per-test authentication refresh. TheBaseTest
class ensures each test method has a valid token, supporting both method and class-level parallelism. - How are tests organized for flexible execution?
- A: Tests are grouped using TestNG's
@Test(groups = {...})
annotation (e.g., smoke, regression) and support parameterized runs. The structure insrc/test/java/tests/
allows targeted execution and comprehensive coverage for different scenarios. - How does the framework handle test results collection?
- A: Test results are collected using
TestResultsReporter.java
andTestResultsRecords.java
, which export structured JSON for integration with systems like Azure DevOps.TestResultLoggerListener.java
(ITestListener) logs test events, parameters, and separators, making logs readable and debugging easier, especially for data-driven tests. - How did I enhance assertions and debugging?
- A: Custom assertion wrappers in
Assertion.java
and matcher extensions inLoggingMatcher.java
log detailed comparisons and outcomes. This provides clear insights into test failures and successes, improving traceability and debugging efficiency. - Why choose Allure for reporting?
- A: Allure provides detailed, user-friendly reports by capturing request and response data through
custom filters. The configuration in
pom.xml
and output inallure-results/
make it easy to visualize test execution and share results with stakeholders. - How is CI/CD integrated?
- A: The CI/CD pipeline uses Java 21+ Docker containers, GitHub Actions, GitHub Pages, and Azure
DevOps
for automated testing, reporting, and deployment. The workflow in
.github/workflows/test-execution.yml
orchestrates test execution, report generation, and publishing. - How is the project structured for clarity?
- A: The project separates main and test utilities into
src/main/java/
andsrc/test/java/
, with organized directories for configuration, reports, and workflows. This structure supports maintainability and scalability as the framework evolves.
Azure DevOps Test Plan Integration
Below are sample screenshots showing how test results are posted and visualized in Azure DevOps Test Plans:



