Skip to content

Commit 58206e0

Browse files
committed
Removed DisplayName annotations
1 parent 367e498 commit 58206e0

File tree

3 files changed

+10
-53
lines changed

3 files changed

+10
-53
lines changed

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/DefaultDbRefResolverUnitTests.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.bson.Document;
2727
import org.bson.types.ObjectId;
2828
import org.junit.jupiter.api.BeforeEach;
29-
import org.junit.jupiter.api.DisplayName;
3029
import org.junit.jupiter.api.Test;
3130
import org.junit.jupiter.api.extension.ExtendWith;
3231
import org.mockito.ArgumentCaptor;
@@ -145,8 +144,7 @@ void bulkFetchContainsDuplicates() {
145144
}
146145

147146
@Test // GH-5065
148-
@DisplayName("GH-5065: Empty Map with @DocumentReference annotation should deserialize to an empty map.")
149-
void resolveEmptyMapIsNotNull() {
147+
void emptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmptyMap() {
150148
DocumentReference documentReference = mock(DocumentReference.class);
151149
when(documentReference.lookup()).thenReturn("{ '_id' : ?#{#target} }");
152150
when(documentReference.sort()).thenReturn("");
@@ -180,8 +178,7 @@ void resolveEmptyMapIsNotNull() {
180178
}
181179

182180
@Test // GH-5065
183-
@DisplayName("GH-5065: Lazy loaded empty Map with @DocumentReference annotation should deserialize to an empty map with a non-null values property.")
184-
void resolveLazyLoadedEmptyMapIsNotNull() {
181+
void lazyLoadedEmptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmptyMapWithANonnullValuesProperty() {
185182
DocumentReference documentReference = mock(DocumentReference.class);
186183
when(documentReference.lookup()).thenReturn("{ '_id' : ?#{#target} }");
187184
when(documentReference.sort()).thenReturn("");

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/MappingMongoConverterTests.java

Lines changed: 7 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
import org.bson.Document;
3636
import org.junit.jupiter.api.BeforeEach;
37-
import org.junit.jupiter.api.DisplayName;
3837
import org.junit.jupiter.api.Nested;
3938
import org.junit.jupiter.api.Test;
4039

@@ -57,13 +56,13 @@
5756
* @author Christoph Strobl
5857
*/
5958

60-
public class MappingMongoConverterTests {
59+
class MappingMongoConverterTests {
6160

6261
private static final String DATABASE = "mapping-converter-tests";
6362

6463
private static @Client MongoClient client;
6564

66-
private MongoDatabaseFactory factory = new SimpleMongoClientDatabaseFactory(client, DATABASE);
65+
private final MongoDatabaseFactory factory = new SimpleMongoClientDatabaseFactory(client, DATABASE);
6766

6867
private MappingMongoConverter converter;
6968
private MongoMappingContext mappingContext;
@@ -483,48 +482,26 @@ public String toString() {
483482
}
484483

485484
@Nested // GH-5065
486-
@DisplayName("GH-5065: Empty Map Tests")
487485
class EmptyMapTests {
488486

489487
@Test // GH-5065
490-
@DisplayName("Test control: Passing test to indicate that the problem is not a more generic issue with maps in general.")
491-
void readsEmptyMapCorrectly() {
492-
org.bson.Document document = org.bson.Document.parse("{\"map\":{}}");
493-
//EmptyMapDocument target = converter.read(EmptyMapDocument.class, document);
494-
assertThat(converter.read(EmptyMapDocument.class, document).map).isNotNull().isEmpty();
495-
assertThat(converter.read(EmptyMapDocument.class, document).getMap()).isNotNull().isEmpty();
496-
}
497-
498-
@Test // GH-5065
499-
@DisplayName("Test control: Converter should read an explicitly assigned null as a null map.")
500-
void readsExplicitlyNullMapCorrectly() {
501-
org.bson.Document document = org.bson.Document.parse("{\"map\":null}");
502-
//EmptyMapDocument target = converter.read(EmptyMapDocument.class, document);
503-
assertThat(converter.read(EmptyMapDocument.class, document).map).isNull();
504-
assertThat(converter.read(EmptyMapDocument.class, document).getMap()).isNull();
505-
}
506-
507-
@Test // GH-5065
508-
@DisplayName("Converter should read an empty object as an empty map when using @DocumentReference.")
509-
void readsEmptyMapWithDocumentReferenceCorrectly() {
488+
void converterShouldReadAnEmptyObjectAsAnEmptyMapWhenUsingDocumentReferenceAnnotation() {
510489
org.bson.Document document = org.bson.Document.parse("{\"map\":{}}");
511490
//DocumentReferenceEmptyMapDocument target = converter.read(DocumentReferenceEmptyMapDocument.class, document);
512491
assertThat(converter.read(DocumentReferenceEmptyMapDocument.class, document).map).isNotNull().isEmpty();
513492
assertThat(converter.read(DocumentReferenceEmptyMapDocument.class, document).getMap()).isNotNull().isEmpty();
514493
}
515494

516495
@Test // GH-5065
517-
@DisplayName("Converter should read an explicitly assigned null as a null map when using @DocumentReference.")
518-
void readsExplicitlyNullMapWithDocumentReferenceCorrectly() {
496+
void converterShouldReadAnExplicitlyAssignedNullAsANullMapWhenUsingDocumentReferenceAnnotation() {
519497
org.bson.Document document = org.bson.Document.parse("{\"map\":null}");
520498
//DocumentReferenceEmptyMapDocument target = converter.read(DocumentReferenceEmptyMapDocument.class, document);
521499
assertThat(converter.read(DocumentReferenceEmptyMapDocument.class, document).map).isNull();
522500
assertThat(converter.read(DocumentReferenceEmptyMapDocument.class, document).getMap()).isNull();
523501
}
524502

525503
@Test // GH-5065
526-
@DisplayName("Converter should read an empty object as an empty map with a valid values property when using @DocumentReference(lazy = true).")
527-
void readsEmptyMapWithLazyLoadedDocumentReferenceCorrectly() {
504+
void converterShouldReadAnEmptyObjectAsAnEmptyMapWithAValidValuesPropertyWhenUsingDocumentReferenceAnnotationWithLazyEqualToTrue() {
528505
org.bson.Document document = org.bson.Document.parse("{\"map\":{}}");
529506
//LazyDocumentReferenceEmptyMapDocument target = converter.read(LazyDocumentReferenceEmptyMapDocument.class, document);
530507
assertThat(converter.read(LazyDocumentReferenceEmptyMapDocument.class, document).map).isNotNull().isEmpty();
@@ -534,36 +511,21 @@ void readsEmptyMapWithLazyLoadedDocumentReferenceCorrectly() {
534511
}
535512

536513
@Test // GH-5065
537-
@DisplayName("Converter should read an empty object as an empty map when using @DBRef.")
538-
void readsEmptyMapWithDBRefCorrectly() {
514+
void converterShouldReadAnEmptyObjectAsAnEmptyMapWhenUsingDBRefAnnotation() {
539515
org.bson.Document document = org.bson.Document.parse("{\"map\":{}}");
540516
//DBRefEmptyMapDocument target = converter.read(DBRefEmptyMapDocument.class, document);
541517
assertThat(converter.read(DBRefEmptyMapDocument.class, document).map).isNotNull().isEmpty();
542518
assertThat(converter.read(DBRefEmptyMapDocument.class, document).getMap()).isNotNull().isEmpty();
543519
}
544520

545521
@Test // GH-5065
546-
@DisplayName("Converter should read an explicitly assigned null as a null map when using @DBRef.")
547-
void readsExplicitlyNullMapWithDBRefCorrectly() {
522+
void converterShouldReadAnExplicitlyAssignedNullAsANullMapWhenUsingDBRefAnnotation() {
548523
org.bson.Document document = org.bson.Document.parse("{\"map\":null}");
549524
//DBRefEmptyMapDocument target = converter.read(DBRefEmptyMapDocument.class, document);
550525
assertThat(converter.read(DBRefEmptyMapDocument.class, document).map).isNull();
551526
assertThat(converter.read(DBRefEmptyMapDocument.class, document).getMap()).isNull();
552527
}
553528

554-
static class EmptyMapDocument {
555-
556-
Map<String, String> map;
557-
558-
public EmptyMapDocument(Map<String, String> map) {
559-
this.map = map;
560-
}
561-
562-
Map<String, String> getMap() {
563-
return map;
564-
}
565-
}
566-
567529
static class DocumentReferenceEmptyMapDocument {
568530

569531
@DocumentReference

spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/convert/ReferenceLookupDelegateUnitTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
import org.bson.Document;
2525
import org.junit.jupiter.api.BeforeEach;
26-
import org.junit.jupiter.api.DisplayName;
2726
import org.junit.jupiter.api.Test;
2827
import org.junit.jupiter.api.extension.ExtendWith;
2928
import org.mockito.Mock;
@@ -99,8 +98,7 @@ void shouldResolveEmptyMapOnEmptyTargetCollection() {
9998
}
10099

101100
@Test // GH-5065
102-
@DisplayName("GH-5065: Empty Map with @DocumentReference annotation should deserialize to an empty map.")
103-
void shouldResolveEmptyMapOnEmptyDocumentReferenceMapProperty() {
101+
void emptyMapWithDocumentReferenceAnnotationShouldDeserializeToAnEmptyMap() {
104102
DocumentReference documentReference = mock(DocumentReference.class);
105103
when(documentReference.lookup()).thenReturn("{ '_id' : ?#{#target} }");
106104
when(documentReference.sort()).thenReturn("");

0 commit comments

Comments
 (0)