@@ -91,7 +91,7 @@ void shouldReturnErrorOnDeleteMethod() {
9191 assertThrows (NullPointerException .class ,() -> template .delete ("Collection" , null ));
9292 assertThrows (NullPointerException .class ,() -> template .delete ((String ) null , filter ));
9393
94- assertThrows (NullPointerException .class ,() -> template .delete (Person .class , null ));
94+ assertThrows (NullPointerException .class ,() -> template .delete (MongoDBPerson .class , null ));
9595 assertThrows (NullPointerException .class ,() -> template .delete ((Class <Object >) null , filter ));
9696 }
9797
@@ -105,15 +105,15 @@ void shouldDeleteWithCollectionName() {
105105 @ Test
106106 void shouldDeleteWithEntity () {
107107 Bson filter = eq ("name" , "Poliana" );
108- template .delete (Person .class , filter );
108+ template .delete (MongoDBPerson .class , filter );
109109 Mockito .verify (manager ).delete ("Person" , filter );
110110 }
111111
112112 @ Test
113113 void shouldDeleteAll () {
114- EntityMetadata metadata = entities .get (Person .class );
114+ EntityMetadata metadata = entities .get (MongoDBPerson .class );
115115 DeleteQuery query = DeleteQuery .delete ().from (metadata .name ()).build ();
116- template .deleteAll (Person .class );
116+ template .deleteAll (MongoDBPerson .class );
117117 Mockito .verify (manager ).delete (query );
118118 }
119119
@@ -126,7 +126,7 @@ void shouldReturnErrorOnSelectMethod() {
126126 assertThrows (NullPointerException .class , () -> template .select ((String ) null , filter ));
127127
128128 assertThrows (NullPointerException .class , () -> template .select ((Class <?>) null , null ));
129- assertThrows (NullPointerException .class , () -> template .select (Person .class , null ));
129+ assertThrows (NullPointerException .class , () -> template .select (MongoDBPerson .class , null ));
130130 assertThrows (NullPointerException .class , () -> template .select ((Class <?>) null , filter ));
131131 }
132132
@@ -138,9 +138,9 @@ void shouldSelectWithCollectionName() {
138138 Bson filter = eq ("name" , "Poliana" );
139139 Mockito .when (manager .select ("Person" , filter ))
140140 .thenReturn (Stream .of (entity ));
141- Stream <Person > stream = template .select ("Person" , filter );
141+ Stream <MongoDBPerson > stream = template .select ("Person" , filter );
142142 Assertions .assertNotNull (stream );
143- Person poliana = stream .findFirst ()
143+ MongoDBPerson poliana = stream .findFirst ()
144144 .orElseThrow (() -> new IllegalStateException ("There is an issue on the test" ));
145145
146146 Assertions .assertNotNull (poliana );
@@ -156,9 +156,9 @@ void shouldSelectWithEntity() {
156156 Bson filter = eq ("name" , "Poliana" );
157157 Mockito .when (manager .select ("Person" , filter ))
158158 .thenReturn (Stream .of (entity ));
159- Stream <Person > stream = template .select (Person .class , filter );
159+ Stream <MongoDBPerson > stream = template .select (MongoDBPerson .class , filter );
160160 Assertions .assertNotNull (stream );
161- Person poliana = stream .findFirst ()
161+ MongoDBPerson poliana = stream .findFirst ()
162162 .orElseThrow (() -> new IllegalStateException ("There is an issue on the test" ));
163163
164164 Assertions .assertNotNull (poliana );
@@ -188,8 +188,8 @@ void shouldReturnErrorOnAggregateMethod() {
188188 assertThrows (NullPointerException .class , () -> template .aggregate ((String ) null , pipeline ));
189189 assertThrows (NullPointerException .class , () -> template .aggregate ((String ) null , pipelineArray ));
190190 assertThrows (NullPointerException .class , () -> template .aggregate ((String ) null , bson ));
191- assertThrows (NullPointerException .class , () -> template .aggregate (Person .class , (List <Bson >) null ));
192- assertThrows (NullPointerException .class , () -> template .aggregate (Person .class , (Bson []) null ));
191+ assertThrows (NullPointerException .class , () -> template .aggregate (MongoDBPerson .class , (List <Bson >) null ));
192+ assertThrows (NullPointerException .class , () -> template .aggregate (MongoDBPerson .class , (Bson []) null ));
193193
194194 }
195195
@@ -211,7 +211,7 @@ void shouldAggregateWithEntity() {
211211 Aggregates .group ("$stars" , Accumulators .sum ("count" , 1 ))
212212 };
213213
214- template .aggregate (Person .class , predicates );
214+ template .aggregate (MongoDBPerson .class , predicates );
215215 Mockito .verify (manager ).aggregate ("Person" , predicates );
216216 }
217217
@@ -228,7 +228,7 @@ void shouldCountByFilterWithCollectionName() {
228228 void shouldCountByFilterWithEntity () {
229229 var filter = eq ("name" , "Poliana" );
230230
231- template .count (Person .class , filter );
231+ template .count (MongoDBPerson .class , filter );
232232
233233 Mockito .verify (manager ).count ("Person" , filter );
234234 }
@@ -239,8 +239,8 @@ void shouldReturnErrorOnCountByFilterMethod() {
239239 assertThrows (NullPointerException .class , () -> template .count ((String ) null , null ));
240240 assertThrows (NullPointerException .class , () -> template .count ((String ) null , filter ));
241241 assertThrows (NullPointerException .class , () -> template .count ("Person" , null ));
242- assertThrows (NullPointerException .class , () -> template .count ((Class <Person >) null , null ));
243- assertThrows (NullPointerException .class , () -> template .count ((Class <Person >) null , filter ));
244- assertThrows (NullPointerException .class , () -> template .count (Person .class , null ));
242+ assertThrows (NullPointerException .class , () -> template .count ((Class <MongoDBPerson >) null , null ));
243+ assertThrows (NullPointerException .class , () -> template .count ((Class <MongoDBPerson >) null , filter ));
244+ assertThrows (NullPointerException .class , () -> template .count (MongoDBPerson .class , null ));
245245 }
246246}
0 commit comments