Fix formatting
This commit is contained in:
parent
2e54ddc841
commit
a0a9ef1b2c
|
@ -1,11 +1,8 @@
|
||||||
package org.baeldung.repository;
|
package org.baeldung.repository;
|
||||||
|
|
||||||
|
|
||||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
|
||||||
import org.baeldung.model.User;
|
import org.baeldung.model.User;
|
||||||
|
|
||||||
|
|
||||||
public interface UserRepository extends MongoRepository<User, String> {
|
public interface UserRepository extends MongoRepository<User, String> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
|
||||||
xmlns:p="http://www.springframework.org/schema/p"
|
xmlns:p="http://www.springframework.org/schema/p" xmlns:mongo="http://www.springframework.org/schema/data/mongo"
|
||||||
xmlns:mongo="http://www.springframework.org/schema/data/mongo"
|
|
||||||
xsi:schemaLocation="
|
xsi:schemaLocation="
|
||||||
http://www.springframework.org/schema/beans
|
http://www.springframework.org/schema/beans
|
||||||
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
|
http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
|
||||||
|
@ -22,6 +21,6 @@
|
||||||
|
|
||||||
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
|
<bean class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor"/>
|
||||||
|
|
||||||
<mongo:repositories base-package="org.baeldung.repository" mongo-template-ref="mongoTemplate" />
|
<mongo:repositories base-package="org.baeldung.repository" mongo-template-ref="mongoTemplate"/>
|
||||||
|
|
||||||
</beans>
|
</beans>
|
|
@ -111,7 +111,7 @@ public class UserRepositoryIntegrationTest {
|
||||||
user.setName("Adam");
|
user.setName("Adam");
|
||||||
mongoOps.insert(user);
|
mongoOps.insert(user);
|
||||||
|
|
||||||
List<User> users = userRepository.findAll(new Sort(Sort.Direction.ASC,"name"));
|
List<User> users = userRepository.findAll(new Sort(Sort.Direction.ASC, "name"));
|
||||||
|
|
||||||
assertThat(users.size(), is(2));
|
assertThat(users.size(), is(2));
|
||||||
assertThat(users.get(0).getName(), is("Adam"));
|
assertThat(users.get(0).getName(), is("Adam"));
|
||||||
|
|
Loading…
Reference in New Issue