Class IntegrationTestsHelper
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe environment variable that can be used to override the temporary directory used by the integration tests. -
Method Summary
Modifier and TypeMethodDescriptionstatic <A extends Annotation,T>
TextractFromAnnotatedElements(org.junit.jupiter.api.TestInfo testInfo, Class<A> annotationClass, Function<A, T> extractor, T defaultValue) Extract a value from the annotated elements of the test method and class.static URIgetTemporaryDirectory(Path defaultLocalDirectory) Get the temporary directory to use for integration tests.static <A extends Annotation>
Map<String, String> mergeFromAnnotatedElements(org.junit.jupiter.api.TestInfo testInfo, Class<A> annotationClass, Function<A, String[]> propertiesExtractor, Map<String, String> defaults) Collect properties from annotated elements in the test method and class.
-
Field Details
-
INTEGRATION_TEST_TEMP_DIR_ENV_VAR
The environment variable that can be used to override the temporary directory used by the integration tests.- See Also:
-
-
Method Details
-
getTemporaryDirectory
Get the temporary directory to use for integration tests.If the environment variable
INTEGRATION_TEST_TEMP_DIR_ENV_VARis set, it will be used as the temporary directory. Otherwise, the default local temporary directory will be used.The environment variable should be a URI, e.g.
"file:///tmp/polaris"or"s3://bucket/polaris". If the URI does not have a scheme, it will be assumed to be a local file URI. -
extractFromAnnotatedElements
public static <A extends Annotation,T> T extractFromAnnotatedElements(org.junit.jupiter.api.TestInfo testInfo, Class<A> annotationClass, Function<A, T> extractor, T defaultValue) Extract a value from the annotated elements of the test method and class.This method looks for annotations of the specified type on both the test method and the test class, extracts the value using the provided extractor function, and returns it.
If the value is present in both the method and class annotations, the value from the method annotation will be used. If the value is not present in either the method or class annotations, this method returns the default value.
-
mergeFromAnnotatedElements
public static <A extends Annotation> Map<String,String> mergeFromAnnotatedElements(org.junit.jupiter.api.TestInfo testInfo, Class<A> annotationClass, Function<A, String[]> propertiesExtractor, Map<String, String> defaults) Collect properties from annotated elements in the test method and class.This method looks for annotations of the specified type on both the test method and the test class, extracts properties using the provided extractor function, and combines them into a map. If a property appears in both the method and class annotations, the value from the method annotation will be used.
-