From fb26b2950e796d26ba6846d290069554c415404b Mon Sep 17 00:00:00 2001 From: Jeff Yemin Date: Wed, 23 Jul 2025 13:23:39 -0400 Subject: [PATCH] Fix parameterized test names in CrudProseTest Previously, for a parameterized test like CrudProseTest::testBulkWriteHandlesWriteErrorsAcrossBatches, the test names in the JUnit XML output (and therefore in CI) were [1] false [2] true Now the test names are 6. MongoClient.bulkWrite handles individual WriteErrors across batches--ordered:false 6. MongoClient.bulkWrite handles individual WriteErrors across batches--ordered:true and appear in the IDEA UI like 6. MongoClient.bulkWrite handles individual WriteErrors across batches --ordered:false --ordered:true and in Gradle output like 6. MongoClient.bulkWrite handles individual WriteErrors across batches Test 6. MongoClient.bulkWrite handles individual WriteErrors across batches--ordered:false PASSED (5.1s) Test 6. MongoClient.bulkWrite handles individual WriteErrors across batches--ordered:true PASSED --- .../test/functional/com/mongodb/client/CrudProseTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/driver-sync/src/test/functional/com/mongodb/client/CrudProseTest.java b/driver-sync/src/test/functional/com/mongodb/client/CrudProseTest.java index a72353abde..d269a3cad5 100644 --- a/driver-sync/src/test/functional/com/mongodb/client/CrudProseTest.java +++ b/driver-sync/src/test/functional/com/mongodb/client/CrudProseTest.java @@ -238,7 +238,7 @@ protected void testBulkWriteCollectsWriteConcernErrorsAcrossBatches() throws Int } @DisplayName("6. MongoClient.bulkWrite handles individual WriteErrors across batches") - @ParameterizedTest + @ParameterizedTest(name = "6. MongoClient.bulkWrite handles individual WriteErrors across batches--ordered:{0}") @ValueSource(booleans = {false, true}) protected void testBulkWriteHandlesWriteErrorsAcrossBatches(final boolean ordered) { assumeTrue(serverVersionAtLeast(8, 0)); @@ -380,7 +380,7 @@ private void testBulkWriteSplitsWhenExceedingMaxMessageSizeBytesDueToNsInfo( } @DisplayName("12. MongoClient.bulkWrite returns an error if no operations can be added to ops") - @ParameterizedTest + @ParameterizedTest(name = "12. MongoClient.bulkWrite returns an error if no operations can be added to ops--tooLarge:{0}") @ValueSource(strings = {"document", "namespace"}) protected void testBulkWriteSplitsErrorsForTooLargeOpsOrNsInfo(final String tooLarge) { assumeTrue(serverVersionAtLeast(8, 0)); @@ -465,7 +465,8 @@ protected void testWriteConcernOfAllBatchesWhenUnacknowledgedRequested() { /** * This test is not from the specification. */ - @ParameterizedTest + @DisplayName("insertMustGenerateIdAtMostOnce") + @ParameterizedTest(name = "insertMustGenerateIdAtMostOnce--documentClass:{0}, expectIdGenerated:{1}") @MethodSource("insertMustGenerateIdAtMostOnceArgs") protected void insertMustGenerateIdAtMostOnce( final Class documentClass,