@@ -35,7 +35,7 @@ import org.springframework.test.annotation.DirtiesContext;
|
||||
* Demonstrates various possibilities to customize the behavior of a repository.
|
||||
*
|
||||
* @author Jens Schauder
|
||||
* @author Divya Srivastava
|
||||
* @author Divya Srivastava
|
||||
*/
|
||||
@SpringBootTest(classes = AggregateConfiguration.class)
|
||||
@AutoConfigureDataJdbc
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
package example.springdata.ldap;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -24,6 +24,7 @@ import javax.naming.InvalidNameException;
|
||||
import javax.naming.ldap.LdapName;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@@ -31,6 +32,7 @@ import org.springframework.boot.test.context.SpringBootTest;
|
||||
* Integration tests for {@link PersonRepository}.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @author Divya Srivastava
|
||||
*/
|
||||
@SpringBootTest
|
||||
public class PersonRepositoryIntegrationTests {
|
||||
@@ -43,7 +45,7 @@ public class PersonRepositoryIntegrationTests {
|
||||
* @throws InvalidNameException
|
||||
*/
|
||||
@Test
|
||||
public void findOneByName() throws InvalidNameException {
|
||||
void findOneByName() throws InvalidNameException {
|
||||
|
||||
Optional<Person> person = personRepository.findById(new LdapName("uid=bob,ou=people,dc=springframework,dc=org"));
|
||||
|
||||
@@ -58,7 +60,7 @@ public class PersonRepositoryIntegrationTests {
|
||||
* Find all entries in the base path.
|
||||
*/
|
||||
@Test
|
||||
public void findAll() {
|
||||
void findAll() {
|
||||
|
||||
Iterable<Person> people = personRepository.findAll();
|
||||
|
||||
@@ -69,7 +71,7 @@ public class PersonRepositoryIntegrationTests {
|
||||
* Find all {@link Person} objects starting with {@code Ham} in the field {@code lastname}.
|
||||
*/
|
||||
@Test
|
||||
public void findByLastname() {
|
||||
void findByLastname() {
|
||||
|
||||
List<Person> people = personRepository.findByLastnameStartsWith("Ham");
|
||||
|
||||
@@ -82,7 +84,7 @@ public class PersonRepositoryIntegrationTests {
|
||||
* @throws InvalidNameException
|
||||
*/
|
||||
@Test
|
||||
public void addUser() throws InvalidNameException {
|
||||
void addUser() throws InvalidNameException {
|
||||
|
||||
Person walter = new Person();
|
||||
walter.setFullName("Walter White");
|
||||
|
||||
Reference in New Issue
Block a user