A couple of useful simple test utility classes
This is a collection of simple test utility classes
- PerformanceEvaluator: Quickly evaluate the performance of your code.
- ObjectExtractor: Quickly extract objects from test resource folders
- Java version 17 and above
Add the following dependency to your pom.xml:
<dependency>
<groupId>com.livetheoogway.commons</groupId>
<artifactId>testutils</artifactId>
<version>1.0</version>
</dependency>
// In order to run an operation 100 times and evaluate its performance, use the PerformanceEvaluator
PerformanceEvaluator performanceEvaluator = new PerformanceEvaluator();
performanceEvaluator.evaluate(100, () -> {
// your code here
});
// in order to extract an object from a test resource folder, use the ObjectExtractor
ObjectExtractor objectExtractor = new ObjectExtractor();
objectExtractor.extract("path/to/resource/file", SomeClass.class);