This github repository serves as a sample project designed to illustrate the process of using RoostGPT (an AI-powered tool) which streamlines the mechanism of creating test cases, enabling developers to improve code quality and accelerate development workflows.
Sample-api demonstrates the significance of generating API tests based on API specification files. With RoostGPT, you can quickly create comprehensive and accurate tests for your APIs, reducing the manual effort required for testing.
The development process of the Sample-api integrates cutting-edge AI-powered tools, notably RoostGPT, alongside established practices:
The repository is implemented with sample APIs along with its specification files.
RoostGPT is utilized to generate API tests based on API specification files. This innovative approach enhances test coverage and efficiency in the development process.
Maven is used as the build automation tool to compile the code and execute AI-generated unit tests. This ensures thorough validation of the application's functionality.
The following steps will guide you through the process of executing RoostGPT generated tests, to verify the functionality and behavior of the tool.
- Java Development Kit (JDK) installed on your system.
- Maven installed on your system.
git clone https://github.com/roost-io/sample-api.git
cd sample-api
mvn compile or mvn install
mvn test
Maven will execute the tests, and display the test results in the terminal.
If you want to run specific test classes or methods, you can use Maven's Surefire plugin to filter tests. Use the following command format:
- To run specific test class:
mvn -Dtest=TestClassName test
Replace TestClassName with the name of the class containing the tests you want to run.
- To run specific test method within a class:
mvn -Dtest=TestClassName#testMethodName test
Replace testMethodName with the name of the test method you want to run.
After running the tests, review the output in the terminal. Maven will display information about the tests executed, including any failures or errors encountered.
For more information about RoostGPT or our other products and services, please visit our website at roost.ai or contact us at support@roost.ai.