Skip to content

Commit

Permalink
Log start and end of MongoDriverHanoiTest
Browse files Browse the repository at this point in the history
  • Loading branch information
prdoyle committed Jul 6, 2024
1 parent 6598fd5 commit 263c43a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ void runTearDown(TestInfo testInfo) {
logTest("\\=== Done", testInfo);
}

private static void logTest(String verb, TestInfo testInfo) {
public static void logTest(String verb, TestInfo testInfo) {
String method =
testInfo.getTestClass().map(Class::getSimpleName).orElse(null)
+ "."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedDeque;
import java.util.stream.Stream;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.TestInfo;
import works.bosk.DriverStack;
import works.bosk.drivers.HanoiTest;
import works.bosk.junit.ParametersByName;
Expand Down Expand Up @@ -34,6 +37,18 @@ static void setupMongoConnection() {
mongoService = new MongoService();
}

@BeforeEach
void logStart(TestInfo testInfo) {
AbstractMongoDriverTest.logTest("/=== Start", testInfo);
}

@AfterEach
void logDone(TestInfo testInfo) {
shutdownOperations.forEach(Runnable::run);
shutdownOperations.clear();
AbstractMongoDriverTest.logTest("\\=== Done", testInfo);
}

@SuppressWarnings("unused")
static Stream<TestParameters.ParameterSet> parameters() {
return TestParameters.driverSettings(
Expand Down

0 comments on commit 263c43a

Please sign in to comment.