33import static org .hamcrest .CoreMatchers .is ;
44import static org .junit .Assert .assertThat ;
55
6-
76import java .util .List ;
87
98import org .baeldung .config .MongoConfig ;
1312import org .springframework .test .context .ContextConfiguration ;
1413import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
1514
16-
1715@ RunWith (SpringJUnit4ClassRunner .class )
1816@ ContextConfiguration (classes = MongoConfig .class )
1917public class QueryMethodsIntegrationTest extends BaseQueryIntegrationTest {
@@ -32,7 +30,7 @@ public void givenUsersExist_whenFindingUsersByName_thenUsersAreFound() {
3230 List <User > users = userRepository .findByName ("Eric" );
3331 assertThat (users .size (), is (1 ));
3432 }
35-
33+
3634 @ Test
3735 public void givenUsersExist_whenFindingUsersWithAgeCreaterThanAndLessThan_thenUsersAreFound () {
3836 User user = new User ();
@@ -53,7 +51,7 @@ public void givenUsersExist_whenFindingUsersWithAgeCreaterThanAndLessThan_thenUs
5351 List <User > users = userRepository .findByAgeBetween (26 , 40 );
5452 assertThat (users .size (), is (1 ));
5553 }
56-
54+
5755 @ Test
5856 public void givenUsersExist_whenFindingUserWithNameStartWithA_thenUsersAreFound () {
5957 User user = new User ();
@@ -74,7 +72,7 @@ public void givenUsersExist_whenFindingUserWithNameStartWithA_thenUsersAreFound(
7472 List <User > users = userRepository .findByNameStartingWith ("A" );
7573 assertThat (users .size (), is (2 ));
7674 }
77-
75+
7876 @ Test
7977 public void givenUsersExist_whenFindingUserWithNameEndWithC_thenUsersAreFound () {
8078 User user = new User ();
@@ -93,10 +91,10 @@ public void givenUsersExist_whenFindingUserWithNameEndWithC_thenUsersAreFound()
9391 mongoOps .insert (user );
9492
9593 List <User > users = userRepository .findByNameEndingWith ("c" );
96-
94+
9795 assertThat (users .size (), is (1 ));
9896 }
99-
97+
10098 @ Test
10199 public void givenUsersExist_whenFindingUsersAndSortThem_thenUsersAreFoundAndSorted () {
102100 User user = new User ();
@@ -115,8 +113,7 @@ public void givenUsersExist_whenFindingUsersAndSortThem_thenUsersAreFoundAndSort
115113 mongoOps .insert (user );
116114
117115 List <User > users = userRepository .findByNameLikeOrderByAgeAsc ("A" );
118-
116+
119117 assertThat (users .size (), is (2 ));
120118 }
121119}
122-
0 commit comments