Skip to content
This repository was archived by the owner on Oct 26, 2023. It is now read-only.

Commit 0f952f1

Browse files
committed
MongoDB / JPA - Cleanups.
1 parent 2568f99 commit 0f952f1

File tree

11 files changed

+41
-147
lines changed

11 files changed

+41
-147
lines changed

jpa/src/test/java/com/oreilly/springdata/jpa/AbstractIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* @author Oliver Gierke
3737
*/
3838
@RunWith(SpringJUnit4ClassRunner.class)
39-
@ContextConfiguration(classes = { ApplicationConfig.class })
39+
@ContextConfiguration(classes = ApplicationConfig.class)
4040
@Transactional
4141
public abstract class AbstractIntegrationTest {
4242

jpa/src/test/java/com/oreilly/springdata/jpa/ApplicationConfigTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import org.springframework.context.support.ClassPathXmlApplicationContext;
2525

2626
/**
27-
* Test case bootstrapping both JavaConfig an XML configuration to validate configuration.
27+
* Test case bootstrapping both JavaConfig and XML configuration to validate configuration.
2828
*
2929
* @author Oliver Gierke
3030
*/

jpa/src/test/java/com/oreilly/springdata/jpa/CollectionPathMatcher.java

Lines changed: 0 additions & 71 deletions
This file was deleted.

jpa/src/test/java/com/oreilly/springdata/jpa/LineItemMatcher.java

Lines changed: 0 additions & 63 deletions
This file was deleted.

jpa/src/test/java/com/oreilly/springdata/jpa/core/CoreMatchers.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,28 @@
2020
import org.hamcrest.Matcher;
2121

2222
/**
23+
* Custom matchers to ease assertions on our domain classes.
2324
*
2425
* @author Oliver Gierke
2526
*/
2627
public class CoreMatchers {
2728

29+
/**
30+
* Syntactic sugar to make Matchers more readable.
31+
*
32+
* @param matcher must not be {@literal null}.
33+
* @return
34+
*/
2835
public static <T> Matcher<T> with(Matcher<T> matcher) {
2936
return matcher;
3037
}
3138

39+
/**
40+
* Matches if the {@link Product} has the given name.
41+
*
42+
* @param name must not be {@literal null}.
43+
* @return
44+
*/
3245
public static Matcher<Product> named(String name) {
3346
return hasProperty("name", is(name));
3447
}

jpa/src/test/java/com/oreilly/springdata/jpa/core/CustomerRepositoryIntegrationTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import com.oreilly.springdata.jpa.AbstractIntegrationTest;
2525

2626
/**
27+
* Integration tests for {@link CustomerRepository}.
2728
*
2829
* @author Oliver Gierke
2930
*/

jpa/src/test/java/com/oreilly/springdata/jpa/core/JpaCustomerRepositoryIntegrationTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@
2626
import com.oreilly.springdata.jpa.AbstractIntegrationTest;
2727

2828
/**
29+
* Integration test for the manual implementation ({@link JpaCustomerRepository}) of the {@link CustomerRepository}
30+
* interface.
31+
*
2932
* @author Oliver Gierke
3033
*/
3134
@ActiveProfiles("jpa")

jpa/src/test/java/com/oreilly/springdata/jpa/order/OrderMatchers.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,38 @@
2222
import com.oreilly.springdata.jpa.core.Product;
2323

2424
/**
25+
* Matchers to ease assertions on found {@link Order}s.
2526
*
2627
* @author Oliver Gierke
2728
*/
2829
public class OrderMatchers {
2930

31+
/**
32+
* Matches if the source {@link Iterable} has an {@link Order} that matches the given {@link Matcher}.
33+
*
34+
* @param matcher must not be {@literal null}.
35+
* @return
36+
*/
3037
public static <T> Matcher<Iterable<? super T>> containsOrder(Matcher<? super T> matcher) {
3138
return hasItem(matcher);
3239
}
3340

41+
/**
42+
* Matches if the {@link Order} has a {@link LineItem} matching the given {@link Matcher}.
43+
*
44+
* @param matcher must not be {@literal null}.
45+
* @return
46+
*/
3447
public static Matcher<Order> LineItem(Matcher<LineItem> matcher) {
3548
return hasProperty("lineItems", hasItem(matcher));
3649
}
3750

51+
/**
52+
* Matches if the {@link LineItem} refers to a {@link Product} that matches the given {@link Matcher}.
53+
*
54+
* @param matcher must not be {@literal null}.
55+
* @return
56+
*/
3857
public static Matcher<LineItem> Product(Matcher<Product> matcher) {
3958
return hasProperty("product", matcher);
4059
}

jpa/src/test/java/com/oreilly/springdata/jpa/order/OrderRepositoryIntegrationTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
import com.oreilly.springdata.jpa.core.ProductRepository;
3535

3636
/**
37+
* Integration tests for {@link OrderRepository}.
38+
*
3739
* @author Oliver Gierke
3840
*/
3941
public class OrderRepositoryIntegrationTest extends AbstractIntegrationTest {

mongodb/src/main/resources/META-INF/spring/spring-data-context.xml

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)