Package dev.galasa.framework.api.common
Interface ITestCatalogFetcher
- All Known Implementing Classes:
TestCatalogFetcher
public interface ITestCatalogFetcher
Fetches the raw JSON content of a test catalog for a given stream.
Two fetch modes are provided:
streamTestCatalog(dev.galasa.framework.spi.streams.IStream, java.io.OutputStream)— writes bytes directly to a caller-suppliedOutputStreamwithout buffering the full body in memory. Use this when proxying the catalog to an HTTP response.fetchTestCatalog(dev.galasa.framework.spi.streams.IStream)— reads the full body and returns it as aString. Use this when the caller needs to parse the catalog (e.g. for test selection).
-
Method Summary
Modifier and TypeMethodDescriptionfetchTestCatalog(IStream stream) Fetches the test catalog for the given stream and returns it as a JSON string.voidstreamTestCatalog(IStream stream, OutputStream outputStream) Fetches the test catalog for the given stream and writes the raw JSON bytes directly tooutputStreamwithout buffering the full body in memory.
-
Method Details
-
streamTestCatalog
Fetches the test catalog for the given stream and writes the raw JSON bytes directly tooutputStreamwithout buffering the full body in memory.- Parameters:
stream- the stream whose test catalog URL and optional Maven credentials are used to retrieve the catalog.outputStream- the stream to write catalog bytes into.- Throws:
InternalServletException- if the catalog cannot be fetched, the response status is not 200, the body exceeds the size limit, the content type is invalid, or credentials cannot be resolved.
-
fetchTestCatalog
Fetches the test catalog for the given stream and returns it as a JSON string.- Parameters:
stream- the stream whose test catalog URL and optional Maven credentials are used to retrieve the catalog.- Returns:
- the raw JSON body of the test catalog, or
nullif the stream has no test catalog URL configured. - Throws:
InternalServletException- if the catalog cannot be fetched, the response status is not 200, the body exceeds the size limit, or the credentials cannot be resolved.
-