public class KeepTestUtils
extends java.lang.Object
Keep Test contains utilities usable by all test classes. Most notably loaders for test data from resources/test
Modifier and Type | Class and Description |
---|---|
static class |
KeepTestUtils.TestType
Specifies the Test type: UnitTest or DB-Integration Test Determines directory where test data are loaded from
|
Constructor and Description |
---|
KeepTestUtils() |
Modifier and Type | Method and Description |
---|---|
static io.vertx.core.buffer.Buffer |
getBufferFromResource(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Returns a Test specific JSON Object constructing the path from the test class name
|
static java.io.InputStream |
getInputStream(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Opens a test class specific input stream, convenience method shortening the path that needs to be specified in the method call
|
static io.vertx.core.json.JsonArray |
getJsonArrayFromResource(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Returns a Test specific JSON Array constructing the path from the test class name
|
static io.vertx.core.json.JsonObject |
getJsonFromResource(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Returns a Test specific JSON Object constructing the path from the test class name
|
static java.util.Map<java.lang.String,java.lang.String> |
getMapFromResource(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Returns a Test specific Map constructing the path from the test class name.
|
static java.lang.String |
getStringFromResource(KeepTestUtils.TestType tt,
java.lang.String resourceName,
java.lang.Class<?> clazz)
Returns a Test specific String constructing the path from the test class name.
|
static java.util.stream.Stream<java.lang.String> |
moduleTestsDataFileNames() |
static java.util.stream.Stream<java.lang.String> |
oneModuleTestDataFileName() |
static java.util.stream.Stream<java.lang.String> |
testDataFileNames(KeepTestUtils.TestType testType)
Returns the a list of JSON file names from a Test directory
|
public static io.vertx.core.buffer.Buffer getBufferFromResource(KeepTestUtils.TestType tt, @Nonnull java.lang.String resourceName, java.lang.Class<?> clazz)
Returns a Test specific JSON Object constructing the path from the test class name
tt
- : TestType determines the directory for sample data loadresourceName
- : FileName to be loadedclazz
- : class that called the resourcepublic static java.io.InputStream getInputStream(KeepTestUtils.TestType tt, java.lang.String resourceName, java.lang.Class<?> clazz)
Opens a test class specific input stream, convenience method shortening the path that needs to be specified in the method call
tt
- : TestType determines the directory for sample data loadresourceName
- name of the fileclazz
- class that is calling the resourcepublic static io.vertx.core.json.JsonArray getJsonArrayFromResource(KeepTestUtils.TestType tt, @Nonnull java.lang.String resourceName, java.lang.Class<?> clazz)
Returns a Test specific JSON Array constructing the path from the test class name
tt
- : TestType determines the directory for sample data loadresourceName
- : FileName to be loadedclazz
- : class that called the resourcepublic static io.vertx.core.json.JsonObject getJsonFromResource(KeepTestUtils.TestType tt, @Nonnull java.lang.String resourceName, java.lang.Class<?> clazz)
Returns a Test specific JSON Object constructing the path from the test class name
tt
- : TestType determines the directory for sample data loadresourceName
- : FileName to be loadedclazz
- : class that called the resourcepublic static java.util.Map<java.lang.String,java.lang.String> getMapFromResource(KeepTestUtils.TestType tt, @Nonnull java.lang.String resourceName, java.lang.Class<?> clazz)
Returns a Test specific Map constructing the path from the test class name. Separator is = for key/value
tt
- : TestType determines the directory for sample data loadresourceName
- : FileName to be loadedclazz
- : class that called the resourcepublic static java.lang.String getStringFromResource(KeepTestUtils.TestType tt, @Nonnull java.lang.String resourceName, java.lang.Class<?> clazz)
Returns a Test specific String constructing the path from the test class name. Reads the file into one String
tt
- : TestType determines the directory for sample data loadresourceName
- : FileName to be loadedclazz
- : class that called the resourcepublic static java.util.stream.Stream<java.lang.String> moduleTestsDataFileNames()
public static java.util.stream.Stream<java.lang.String> oneModuleTestDataFileName()
public static java.util.stream.Stream<java.lang.String> testDataFileNames(KeepTestUtils.TestType testType) throws java.io.IOException
Returns the a list of JSON file names from a Test directory
testType
- java.io.IOException