Polishing.

Add `@author` tags to changed files.
Remove Hamcrest usage.

Original pull request #602
Related tickest #583
This commit is contained in:
Jens Schauder
2021-01-29 10:10:58 +01:00
parent 6a894d9334
commit 64c1eeaf05
29 changed files with 150 additions and 100 deletions

View File

@@ -15,9 +15,6 @@
*/
package example.springdata.jpa.querybyexample;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
@@ -27,12 +24,16 @@ import org.springframework.data.domain.Example;
import org.springframework.test.context.junit.jupiter.SpringExtension;
import org.springframework.transaction.annotation.Transactional;
import static org.assertj.core.api.Assertions.*;
/**
* Integration test showing the usage of JPA Query-by-Example support through Spring Data repositories and entities
* using inheritance.
*
* @author Mark Paluch
* @author Oliver Gierke
* @author Divya Srivastava
* @author Jens Schauder
*/
@ExtendWith(SpringExtension.class)
@Transactional
@@ -58,7 +59,7 @@ public class UserRepositoryInheritanceIntegrationTests {
*/
@Test
public void countByExample() {
assertThat(repository.count(Example.of(new User(null, "White", null))), is(3L));
assertThat(repository.count(Example.of(new User(null, "White", null)))).isEqualTo(3L);
}
/**
@@ -66,6 +67,6 @@ public class UserRepositoryInheritanceIntegrationTests {
*/
@Test
public void countSubtypesByExample() {
assertThat(repository.count(Example.of(new SpecialUser(null, "White", null))), is(2L));
assertThat(repository.count(Example.of(new SpecialUser(null, "White", null)))).isEqualTo(2L);
}
}

View File

@@ -38,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional;
* @author Mark Paluch
* @author Oliver Gierke
* @author Jens Schauder
* @author Divya Srivastava
*/
@ExtendWith(SpringExtension.class)
@Transactional