Package de.galan.commons.test
Class Tests
java.lang.Object
de.galan.commons.test.Tests
Common helper methods that are helpful for Test-Classes via static imports.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassertBetween(Double expectedLower, Double expectedUpper, Double actual) static voidassertBetween(Long expectedLow, Long expectedHigh, Long actual) static voidassertBetween(Date expectedFrom, Date expectedTo, Date actual) static voidassertBetween(Date expectedFrom, Date expectedTo, Date actual, boolean truncateMillis) static voidassertDateNear(long msThreshold, Date actual) static voidassertDateNear(long msThreshold, Date actual, boolean truncateMillis) static voidassertDateNear(String timeThreshold, Instant actual) static voidassertDateNear(String timeThreshold, Date actual) static voidassertDateNear(String timeThreshold, Date actual, boolean truncateMillis) static voidassertFileEqualsToString(String filename, Class<?> clz, String actual) static voidassertListEquals(List<?> expected, List<?> actual) static Filestatic FilegetTestDirectory(boolean cleanup) static Stringstatic StringreadFile(InputStream is) static StringreadFile(InputStream is, Charset encoding) static Stringstatic Stringstatic Stringstatic Stringstatic byte[]readFileBinary(Class<?> clazz, String filename)
-
Constructor Details
-
Tests
public Tests()
-
-
Method Details
-
getWorkingDirectory
-
getTestDirectory
-
getTestDirectory
-
readFileBinary
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
readFile
- Throws:
IOException
-
assertFileEqualsToString
public static void assertFileEqualsToString(String filename, Class<?> clz, String actual) throws IOException - Throws:
IOException
-
assertBetween
-
assertListEquals
-
assertBetween
-
assertBetween
-
assertBetween
-
assertDateNear
-
assertDateNear
-
assertDateNear
-
assertDateNear
-
assertDateNear
-