Formatting cleanup
This commit is contained in:
parent
759298a2bc
commit
02ba4a5605
|
@ -7,7 +7,6 @@ import org.junit.Before;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.mongodb.core.MongoOperations;
|
||||
|
||||
|
||||
public class BaseQueryIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -111,4 +111,3 @@ public class DSLQueryIntegrationTest extends BaseQueryIntegrationTest {
|
|||
assertThat(users.size(), is(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||
@ContextConfiguration(classes = MongoConfig.class)
|
||||
public class JSONQueryIntegrationTest extends BaseQueryIntegrationTest {
|
||||
|
||||
@Test
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUsersByName_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setName("Eric");
|
||||
|
@ -31,69 +31,68 @@ public class JSONQueryIntegrationTest extends BaseQueryIntegrationTest {
|
|||
assertThat(users.size(), is(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUsersWithAgeCreaterThanAndLessThan_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setAge(20);
|
||||
user.setName("Jon");
|
||||
mongoOps.insert(user);
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUsersWithAgeCreaterThanAndLessThan_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setAge(20);
|
||||
user.setName("Jon");
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setAge(50);
|
||||
user.setName("Jon");
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setAge(50);
|
||||
user.setName("Jon");
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setAge(33);
|
||||
user.setName("Jim");
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setAge(33);
|
||||
user.setName("Jim");
|
||||
mongoOps.insert(user);
|
||||
|
||||
List<User> users = userRepository.findUsersByAgeBetween(26, 40);
|
||||
assertThat(users.size(), is(1));
|
||||
}
|
||||
List<User> users = userRepository.findUsersByAgeBetween(26, 40);
|
||||
assertThat(users.size(), is(1));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUserWithNameStartWithA_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setName("Eric");
|
||||
user.setAge(45);
|
||||
mongoOps.insert(user);
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUserWithNameStartWithA_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setName("Eric");
|
||||
user.setAge(45);
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setName("Antony");
|
||||
user.setAge(33);
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setName("Antony");
|
||||
user.setAge(33);
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setName("Alice");
|
||||
user.setAge(35);
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setName("Alice");
|
||||
user.setAge(35);
|
||||
mongoOps.insert(user);
|
||||
|
||||
List<User> users = userRepository.findUsersByRegexpName("^A");
|
||||
List<User> users = userRepository.findUsersByRegexpName("^A");
|
||||
|
||||
assertThat(users.size(), is(2));
|
||||
}
|
||||
assertThat(users.size(), is(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUserWithNameEndWithC_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setName("Eric");
|
||||
user.setAge(45);
|
||||
mongoOps.insert(user);
|
||||
@Test
|
||||
public void givenUsersExist_whenFindingUserWithNameEndWithC_thenUsersAreFound() {
|
||||
User user = new User();
|
||||
user.setName("Eric");
|
||||
user.setAge(45);
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setName("Antony");
|
||||
user.setAge(33);
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setName("Antony");
|
||||
user.setAge(33);
|
||||
mongoOps.insert(user);
|
||||
|
||||
user = new User();
|
||||
user.setName("Alice");
|
||||
user.setAge(35);
|
||||
mongoOps.insert(user);
|
||||
user = new User();
|
||||
user.setName("Alice");
|
||||
user.setAge(35);
|
||||
mongoOps.insert(user);
|
||||
|
||||
List<User> users = userRepository.findUsersByRegexpName("c$");
|
||||
List<User> users = userRepository.findUsersByRegexpName("c$");
|
||||
|
||||
assertThat(users.size(), is(1));
|
||||
}
|
||||
assertThat(users.size(), is(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue