Package cz.xtf.junit5.extensions
Class ServiceLogsStreamingRunner
- java.lang.Object
-
- cz.xtf.junit5.extensions.ServiceLogsStreamingRunner
-
- All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback,org.junit.jupiter.api.extension.BeforeAllCallback,org.junit.jupiter.api.extension.Extension
public class ServiceLogsStreamingRunner extends Object implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
ImplementsBeforeAllCallbackin order to provide the logic to retrieve the Service Logs Streaming configurations and activating concreteServiceLogsinstances. Workflow:
- Check whether the
SERVICE_LOGS_STREAMING_PROPERTY_ENABLEDis set and apply a configuration that will enable Service Logs Streaming for all the test classes in such a case - If
SERVICE_LOGS_STREAMING_PROPERTY_ENABLEDis not set, then check whether theSERVICE_LOGS_STREAMING_PROPERTY_CONFIGis set - If the
SERVICE_LOGS_STREAMING_PROPERTY_CONFIGis set, create anSystemPropertyBasedServiceLogsConfigurationsinstance for the property value and store it for the current execution context - If the
SERVICE_LOGS_STREAMING_PROPERTY_CONFIGis not set as well, create aAnnotationBasedServiceLogsConfigurationsand store it for the current execution context - Extract a unique
ServiceLogsSettingsinstance out of the relevant Service Logs Streaming configurations, for it to be used by the current execution context test class - Create a
PodLogsinstance that implements theServiceLogsinterface for a k8s based Cloud environment <
- Call
ServiceLogs.start()to start thePodLogsfor the current execution context test class
-
-
Constructor Summary
Constructors Constructor Description ServiceLogsStreamingRunner()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterAll(org.junit.jupiter.api.extension.ExtensionContext context)voidbeforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
-
-
-
Method Detail
-
beforeAll
public void beforeAll(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
beforeAllin interfaceorg.junit.jupiter.api.extension.BeforeAllCallback
-
afterAll
public void afterAll(org.junit.jupiter.api.extension.ExtensionContext context)
- Specified by:
afterAllin interfaceorg.junit.jupiter.api.extension.AfterAllCallback
-
-