Package com.testomatio.reporter.client
Class DefaultApiClient
- java.lang.Object
-
- com.testomatio.reporter.client.DefaultApiClient
-
- All Implemented Interfaces:
ApiInterface
public class DefaultApiClient extends Object implements ApiInterface
HTTP client for Testomat.io API operations. Handles test run lifecycle and result reporting with proper error handling.
-
-
Constructor Summary
Constructors Constructor Description DefaultApiClient(String apiKey, CustomHttpClient client, DefaultRequestBodyBuilder requestBodyBuilder)Creates API client with custom dependencies for testing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcreateRun(String title)Creates new test run.voidfinishTestRun(String uid, float duration)Marks test run as finished.voidreportTest(String uid, TestResult result)Reports single test result.voidreportTests(String uid, List<TestResult> results)Reports multiple test results in batch.
-
-
-
Constructor Detail
-
DefaultApiClient
public DefaultApiClient(String apiKey, CustomHttpClient client, DefaultRequestBodyBuilder requestBodyBuilder)
Creates API client with custom dependencies for testing.- Parameters:
apiKey- API key for authenticationclient- HTTP client implementationrequestBodyBuilder- request body builder for JSON payloads
-
-
Method Detail
-
createRun
public String createRun(String title) throws IOException
Description copied from interface:ApiInterfaceCreates new test run.- Specified by:
createRunin interfaceApiInterface- Parameters:
title- test run title- Returns:
- unique test run identifier
- Throws:
IOException- if API request fails
-
reportTest
public void reportTest(String uid, TestResult result)
Description copied from interface:ApiInterfaceReports single test result.- Specified by:
reportTestin interfaceApiInterface- Parameters:
uid- test run identifierresult- test result to report
-
reportTests
public void reportTests(String uid, List<TestResult> results)
Description copied from interface:ApiInterfaceReports multiple test results in batch.- Specified by:
reportTestsin interfaceApiInterface- Parameters:
uid- test run identifierresults- test results to report
-
finishTestRun
public void finishTestRun(String uid, float duration)
Description copied from interface:ApiInterfaceMarks test run as finished.- Specified by:
finishTestRunin interfaceApiInterface- Parameters:
uid- test run identifierduration- test run duration in seconds
-
-