@@ -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 (BirthdayPerson .class , null ));
94+ assertThrows (NullPointerException .class ,() -> template .delete (Birthday .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 (BirthdayPerson .class , filter );
109- Mockito .verify (manager ).delete ("BirthdayPerson " , filter );
108+ template .delete (Birthday .class , filter );
109+ Mockito .verify (manager ).delete ("Birthday " , filter );
110110 }
111111
112112 @ Test
113113 void shouldDeleteAll () {
114- EntityMetadata metadata = entities .get (BirthdayPerson .class );
114+ EntityMetadata metadata = entities .get (Birthday .class );
115115 DeleteQuery query = DeleteQuery .delete ().from (metadata .name ()).build ();
116- template .deleteAll (BirthdayPerson .class );
116+ template .deleteAll (Birthday .class );
117117 Mockito .verify (manager ).delete (query );
118118 }
119119
@@ -126,21 +126,21 @@ 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 (BirthdayPerson .class , null ));
129+ assertThrows (NullPointerException .class , () -> template .select (Birthday .class , null ));
130130 assertThrows (NullPointerException .class , () -> template .select ((Class <?>) null , filter ));
131131 }
132132
133133 @ Test
134134 void shouldSelectWithCollectionName () {
135- var entity = CommunicationEntity .of ("BirthdayPerson " , Arrays
135+ var entity = CommunicationEntity .of ("Birthday " , Arrays
136136 .asList (Element .of ("_id" , "Poliana" ),
137137 Element .of ("age" , 30 )));
138138 Bson filter = eq ("name" , "Poliana" );
139- Mockito .when (manager .select ("Person " , filter ))
139+ Mockito .when (manager .select ("Birthday " , filter ))
140140 .thenReturn (Stream .of (entity ));
141- Stream <BirthdayPerson > stream = template .select ("Person " , filter );
141+ Stream <Birthday > stream = template .select ("Birthday " , filter );
142142 Assertions .assertNotNull (stream );
143- BirthdayPerson poliana = stream .findFirst ()
143+ Birthday poliana = stream .findFirst ()
144144 .orElseThrow (() -> new IllegalStateException ("There is an issue on the test" ));
145145
146146 Assertions .assertNotNull (poliana );
@@ -150,15 +150,15 @@ void shouldSelectWithCollectionName() {
150150
151151 @ Test
152152 void shouldSelectWithEntity () {
153- var entity = CommunicationEntity .of ("BirthdayPerson " , Arrays
153+ var entity = CommunicationEntity .of ("Birthday " , Arrays
154154 .asList (Element .of ("_id" , "Poliana" ),
155155 Element .of ("age" , 30 )));
156156 Bson filter = eq ("name" , "Poliana" );
157- Mockito .when (manager .select ("BirthdayPerson " , filter ))
157+ Mockito .when (manager .select ("Birthday " , filter ))
158158 .thenReturn (Stream .of (entity ));
159- Stream <BirthdayPerson > stream = template .select (BirthdayPerson .class , filter );
159+ Stream <Birthday > stream = template .select (Birthday .class , filter );
160160 Assertions .assertNotNull (stream );
161- BirthdayPerson poliana = stream .findFirst ()
161+ Birthday 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 (BirthdayPerson .class , (List <Bson >) null ));
192- assertThrows (NullPointerException .class , () -> template .aggregate (BirthdayPerson .class , (Bson []) null ));
191+ assertThrows (NullPointerException .class , () -> template .aggregate (Birthday .class , (List <Bson >) null ));
192+ assertThrows (NullPointerException .class , () -> template .aggregate (Birthday .class , (Bson []) null ));
193193
194194 }
195195
@@ -211,8 +211,8 @@ void shouldAggregateWithEntity() {
211211 Aggregates .group ("$stars" , Accumulators .sum ("count" , 1 ))
212212 };
213213
214- template .aggregate (BirthdayPerson .class , predicates );
215- Mockito .verify (manager ).aggregate ("BirthdayPerson " , predicates );
214+ template .aggregate (Birthday .class , predicates );
215+ Mockito .verify (manager ).aggregate ("Birthday " , predicates );
216216 }
217217
218218 @ Test
@@ -228,9 +228,9 @@ void shouldCountByFilterWithCollectionName() {
228228 void shouldCountByFilterWithEntity () {
229229 var filter = eq ("name" , "Poliana" );
230230
231- template .count (BirthdayPerson .class , filter );
231+ template .count (Birthday .class , filter );
232232
233- Mockito .verify (manager ).count ("BirthdayPerson " , filter );
233+ Mockito .verify (manager ).count ("Birthday " , filter );
234234 }
235235
236236 @ Test
@@ -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 <BirthdayPerson >) null , null ));
243- assertThrows (NullPointerException .class , () -> template .count ((Class <BirthdayPerson >) null , filter ));
244- assertThrows (NullPointerException .class , () -> template .count (BirthdayPerson .class , null ));
242+ assertThrows (NullPointerException .class , () -> template .count ((Class <Birthday >) null , null ));
243+ assertThrows (NullPointerException .class , () -> template .count ((Class <Birthday >) null , filter ));
244+ assertThrows (NullPointerException .class , () -> template .count (Birthday .class , null ));
245245 }
246246}
0 commit comments