Package tests

Class BaseTest

java.lang.Object
tests.BaseTest
Direct Known Subclasses:
TS01_CreateBook, TS02_GetBook, TS03_UpdateBook, TS04_DeleteBook

public class BaseTest extends Object
Base test class for API tests, providing setup and teardown logic.
  • Field Details

  • Constructor Details

    • BaseTest

      public BaseTest()
  • Method Details

    • setUpSuite

      @BeforeSuite(alwaysRun=true) public void setUpSuite()
      Sets up the test suite with base URI, path, and filters.
    • beforeTest

      @BeforeTest(alwaysRun=true) public void beforeTest()
      Runs before each test, sets up thread context.
    • setup

      @BeforeMethod(alwaysRun=true) public void setup(Method method)
      Runs before each test method, sets up thread context.
      Parameters:
      method - the test method
    • teardown

      @AfterMethod(alwaysRun=true) public void teardown()
      Runs after each test method, clears thread context.
    • resetBooksAfterSuite

      @AfterSuite(alwaysRun=true) public void resetBooksAfterSuite()
      Resets the books after the test suite completes.
    • retryRequest

      public io.restassured.response.Response retryRequest(Supplier<io.restassured.response.Response> request)
      Retries a request if HTTP 429 is received, up to MAX_RETRY_COUNT.
      Parameters:
      request - the request supplier
      Returns:
      the response