DATACMNS-619 - DefaultCrudMethods now exposes accessible methods.
We now make sure that all methods detected are made accessible so that clients using them can reflectively invoke them without additional checks.
This commit is contained in:
@@ -142,6 +142,20 @@ public class DefaultCrudMethodsUnitTests {
|
||||
RepositoryWithDeleteMethodForEntityOverloaded.class.getMethod("delete", Domain.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-619
|
||||
*/
|
||||
@Test
|
||||
public void exposedMethodsAreAccessible() {
|
||||
|
||||
CrudMethods methods = getMethodsFor(RepositoryWithAllCrudMethodOverloaded.class);
|
||||
|
||||
assertThat(methods.getSaveMethod().isAccessible(), is(true));
|
||||
assertThat(methods.getDeleteMethod().isAccessible(), is(true));
|
||||
assertThat(methods.getFindAllMethod().isAccessible(), is(true));
|
||||
assertThat(methods.getFindOneMethod().isAccessible(), is(true));
|
||||
}
|
||||
|
||||
private static CrudMethods getMethodsFor(Class<?> repositoryInterface) {
|
||||
|
||||
RepositoryMetadata metadata = new DefaultRepositoryMetadata(repositoryInterface);
|
||||
|
||||
Reference in New Issue
Block a user