@ -254,6 +254,21 @@ public class DefaultRepositoryInformationUnitTests {
@@ -254,6 +254,21 @@ public class DefaultRepositoryInformationUnitTests {
assertThat ( information . isCustomMethod ( customBaseRepositoryMethod ) , is ( true ) ) ;
}
/ * *
* @see DATACMNS - 943
* @throws Exception
* /
@Test
public void usesCorrectSaveOverload ( ) throws Exception {
RepositoryMetadata metadata = new DefaultRepositoryMetadata ( DummyRepository . class ) ;
RepositoryInformation information = new DefaultRepositoryInformation ( metadata , CrudRepository . class , null ) ;
Method method = DummyRepository . class . getMethod ( "save" , Iterable . class ) ;
assertThat ( information . getTargetClassMethod ( method ) , is ( CrudRepository . class . getMethod ( "save" , Iterable . class ) ) ) ;
}
private static Method getMethodFrom ( Class < ? > type , String name ) {
for ( Method method : type . getMethods ( ) ) {
@ -303,7 +318,7 @@ public class DefaultRepositoryInformationUnitTests {
@@ -303,7 +318,7 @@ public class DefaultRepositoryInformationUnitTests {
@Override
public Iterator < User > iterator ( ) {
return Collections . < User > emptySet ( ) . iterator ( ) ;
return Collections . < User > emptySet ( ) . iterator ( ) ;
}
}
@ -366,4 +381,10 @@ public class DefaultRepositoryInformationUnitTests {
@@ -366,4 +381,10 @@ public class DefaultRepositoryInformationUnitTests {
}
static class Sample { }
interface DummyRepository extends CrudRepository < User , Integer > {
@Override
< S extends User > List < S > save ( Iterable < S > entites ) ;
}
}