48
48
* @author Mark Paluch
49
49
*/
50
50
@ ExtendWith (MongoTemplateExtension .class )
51
- public class MongoRepositoryTextSearchIntegrationTests {
51
+ class MongoRepositoryTextSearchIntegrationTests {
52
52
53
53
private static final FullTextDocument PASSENGER_57 = new FullTextDocument ("1" , "Passenger 57" ,
54
54
"Passenger 57 is an action film that stars Wesley Snipes and Bruce Payne." );
@@ -58,24 +58,24 @@ public class MongoRepositoryTextSearchIntegrationTests {
58
58
"Drop Zone is an action film featuring Wesley Snipes and Gary Busey." );
59
59
60
60
@ Template (initialEntitySet = FullTextDocument .class ) //
61
- static MongoTestTemplate template ;
61
+ private static MongoTestTemplate template ;
62
62
63
- FullTextRepository repo = new MongoRepositoryFactory (this .template ).getRepository (FullTextRepository .class );
63
+ private FullTextRepository repo = new MongoRepositoryFactory (this .template ).getRepository (FullTextRepository .class );
64
64
65
65
@ BeforeEach
66
- public void setUp () {
66
+ void setUp () {
67
67
68
68
template .indexOps (FullTextDocument .class )
69
69
.ensureIndex (new TextIndexDefinitionBuilder ().onField ("title" ).onField ("content" ).build ());
70
70
}
71
71
72
72
@ AfterEach
73
- public void tearDown () {
73
+ void tearDown () {
74
74
template .flush ();
75
75
}
76
76
77
77
@ Test // DATAMONGO-973
78
- public void findAllByTextCriteriaShouldReturnMatchingDocuments () {
78
+ void findAllByTextCriteriaShouldReturnMatchingDocuments () {
79
79
80
80
initRepoWithDefaultDocuments ();
81
81
@@ -86,7 +86,7 @@ public void findAllByTextCriteriaShouldReturnMatchingDocuments() {
86
86
}
87
87
88
88
@ Test // DATAMONGO-973
89
- public void derivedFinderWithTextCriteriaReturnsCorrectResult () {
89
+ void derivedFinderWithTextCriteriaReturnsCorrectResult () {
90
90
91
91
initRepoWithDefaultDocuments ();
92
92
FullTextDocument blade = new FullTextDocument ("4" , "Blade" ,
@@ -102,7 +102,7 @@ public void derivedFinderWithTextCriteriaReturnsCorrectResult() {
102
102
}
103
103
104
104
@ Test // DATAMONGO-973
105
- public void findByWithPaginationWorksCorrectlyWhenUsingTextCriteria () {
105
+ void findByWithPaginationWorksCorrectlyWhenUsingTextCriteria () {
106
106
107
107
initRepoWithDefaultDocuments ();
108
108
@@ -116,7 +116,7 @@ public void findByWithPaginationWorksCorrectlyWhenUsingTextCriteria() {
116
116
}
117
117
118
118
@ Test // DATAMONGO-973
119
- public void findAllByTextCriteriaWithSortWorksCorrectly () {
119
+ void findAllByTextCriteriaWithSortWorksCorrectly () {
120
120
121
121
initRepoWithDefaultDocuments ();
122
122
FullTextDocument snipes = new FullTextDocument ("4" , "Snipes" , "Wesley Trent Snipes is an actor and film producer." );
@@ -130,7 +130,7 @@ public void findAllByTextCriteriaWithSortWorksCorrectly() {
130
130
}
131
131
132
132
@ Test // DATAMONGO-973
133
- public void findByWithSortByScoreViaPageRequestTriggersSortingCorrectly () {
133
+ void findByWithSortByScoreViaPageRequestTriggersSortingCorrectly () {
134
134
135
135
initRepoWithDefaultDocuments ();
136
136
FullTextDocument snipes = new FullTextDocument ("4" , "Snipes" , "Wesley Trent Snipes is an actor and film producer." );
@@ -144,7 +144,7 @@ public void findByWithSortByScoreViaPageRequestTriggersSortingCorrectly() {
144
144
}
145
145
146
146
@ Test // DATAMONGO-973
147
- public void findByWithSortViaPageRequestIgnoresTextScoreWhenSortedByOtherProperty () {
147
+ void findByWithSortViaPageRequestIgnoresTextScoreWhenSortedByOtherProperty () {
148
148
149
149
initRepoWithDefaultDocuments ();
150
150
FullTextDocument snipes = new FullTextDocument ("4" , "Snipes" , "Wesley Trent Snipes is an actor and film producer." );
@@ -158,7 +158,7 @@ public void findByWithSortViaPageRequestIgnoresTextScoreWhenSortedByOtherPropert
158
158
}
159
159
160
160
@ Test // DATAMONGO-973
161
- public void derivedSortForTextScorePropertyWorksCorrectly () {
161
+ void derivedSortForTextScorePropertyWorksCorrectly () {
162
162
163
163
initRepoWithDefaultDocuments ();
164
164
FullTextDocument snipes = new FullTextDocument ("4" , "Snipes" , "Wesley Trent Snipes is an actor and film producer." );
@@ -170,10 +170,11 @@ public void derivedSortForTextScorePropertyWorksCorrectly() {
170
170
}
171
171
172
172
@ Test // DATAMONGO-973, DATAMONGO-2516
173
- public void derivedFinderMethodWithoutFullTextShouldNoCauseTroubleWhenHavingEntityWithTextScoreProperty () {
173
+ void derivedFinderMethodWithoutFullTextShouldNoCauseTroubleWhenHavingEntityWithTextScoreProperty () {
174
174
175
175
initRepoWithDefaultDocuments ();
176
176
List <FullTextDocument > result = repo .findByTitle (DROP_ZONE .getTitle ());
177
+
177
178
assertThat (result .get (0 )).isEqualTo (DROP_ZONE );
178
179
assertThat (result .get (0 ).score ).isNull ();
179
180
}
0 commit comments