DATACMNS-344 - Allow Repositories to work with non-CrudRepositories.
Introduced CrudMethods abstraction obtainable via a RepositoryInformation to inspect a repository for the presence of individual CRUD methods. The default implementation favors more special methods (e.g. the findAll(Pageable) over a simple findAll()). Introduced a CrudInvoker to be able to easily invoke findOne(…) and save(…) independently of whether the target methods are declared explicitly or inherited from CrudRepository. Fixed some test case names to make sure they're executed during the Maven build.
This commit is contained in:
@@ -41,7 +41,7 @@ import org.springframework.web.context.request.ServletWebRequest;
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class LegacyPageableHandlerArgumentResolverUnitTests extends PageableDefaultUnitTest {
|
||||
public class LegacyPageableHandlerArgumentResolverUnitTests extends PageableDefaultUnitTests {
|
||||
|
||||
Method correctMethod, noQualifiers, invalidQualifiers, defaultsMethod, defaultsMethodWithSort,
|
||||
defaultsMethodWithSortAndDirection, otherMethod;
|
||||
|
||||
@@ -17,7 +17,7 @@ package org.springframework.data.web;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.data.web.SortDefaultUnitTest.*;
|
||||
import static org.springframework.data.web.SortDefaultUnitTests.*;
|
||||
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
@@ -40,7 +40,7 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
* @since 1.6
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public abstract class PageableDefaultUnitTest {
|
||||
public abstract class PageableDefaultUnitTests {
|
||||
|
||||
static final int PAGE_SIZE = 47;
|
||||
static final int PAGE_NUMBER = 23;
|
||||
@@ -35,11 +35,11 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link PageableHandlerMethodArgumentResolver}. Pulls in defaulting tests from
|
||||
* {@link PageableDefaultUnitTest}.
|
||||
* {@link PageableDefaultUnitTests}.
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class PageableHandlerMethodArgumentResolverUnitTest extends PageableDefaultUnitTest {
|
||||
public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefaultUnitTests {
|
||||
|
||||
@Test
|
||||
public void buildsUpRequestParameters() {
|
||||
@@ -35,7 +35,7 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver;
|
||||
* @since 1.6
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public abstract class SortDefaultUnitTest {
|
||||
public abstract class SortDefaultUnitTests {
|
||||
|
||||
static final String SORT_0 = "username";
|
||||
static final String SORT_1 = "username,asc";
|
||||
@@ -38,7 +38,7 @@ import org.springframework.web.util.UriComponentsBuilder;
|
||||
* @since 1.6
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class SortHandlerArgumentResolverUnitTests extends SortDefaultUnitTest {
|
||||
public class SortHandlerArgumentResolverUnitTests extends SortDefaultUnitTests {
|
||||
|
||||
static final String SORT_0 = "username";
|
||||
static final String SORT_1 = "username,asc";
|
||||
|
||||
Reference in New Issue
Block a user