🚀 Getting Started with REST
1) Add the dependency
Maven (Parent/BOM patterns as in Core), then:
<dependency>
<groupId>io.github.toobprojects</groupId>
<artifactId>qabase-rest</artifactId>
</dependency>
Gradle (Kotlin DSL)
dependencies {
testImplementation(platform("io.github.toobprojects:qabase-framework:2.2.0"))
testImplementation("io.github.toobprojects:qabase-rest")
}
2) Minimal test using unified REST chaining
In QABase 2.2.0, the preferred style is to chain assertions directly from RestClient. That keeps the request and the expectation in one readable flow.
import com.toob.qabase.QaBaseTest;
import com.toob.qabase.rest.AbstractRestTest;
import com.toob.qabase.rest.client.RestClient;
import com.toob.qabase.rest.support.StatusFamily;
import org.junit.jupiter.api.Test;
@QaBaseTest
class UsersApiTest extends AbstractRestTest { // sets RestAssured baseUri from config
@Test
void listUsers_ok() { // GET /users
RestClient.get("/users")
.statusFamily(StatusFamily.SUCCESS)
.ok()
.contentType("application/json")
.timeUnder(2000)
.attach(); // body → Allure
}
}
If you still have an existing response object, expect(response) remains available. For new tests, prefer the unified chained style because it is easier to read and harder to split apart accidentally.
🔗 See it in action
Want to see a real-world project using these patterns? Check out the QA GoRest Automation.