use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryMetadataUnitTests method discoversDomainTypeOnReturnTypeWrapper.
// DATACMNS-483
@Test
public void discoversDomainTypeOnReturnTypeWrapper() throws Exception {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(OptionalRepository.class);
Method method = OptionalRepository.class.getMethod("findByEmailAddress", String.class);
assertThat(metadata.getReturnedDomainClass(method)).isEqualTo(User.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class AbstractRepositoryMetadataUnitTests method determinesReturnTypeFromPageable.
// DATACMNS-98
@Test
public void determinesReturnTypeFromPageable() throws Exception {
RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class);
Method method = ExtendingRepository.class.getMethod("findByFirstname", Pageable.class, String.class);
assertThat(metadata.getReturnedDomainClass(method)).isEqualTo(User.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class AbstractRepositoryMetadataUnitTests method pageableRepository.
// DATACMNS-453
@Test
public void pageableRepository() {
RepositoryMetadata metadata = new DummyRepositoryMetadata(PagedRepository.class);
assertThat(metadata.isPagingRepository()).isTrue();
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class AbstractRepositoryMetadataUnitTests method determinesReturnTypeFromGenericType.
// DATACMNS-98
@Test
public void determinesReturnTypeFromGenericType() throws Exception {
RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class);
Method method = ExtendingRepository.class.getMethod("someMethod");
assertThat(metadata.getReturnedDomainClass(method)).isEqualTo(GenericType.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class AbstractRepositoryMetadataUnitTests method resolvesTypeParameterReturnType.
// DATACMNS-98
@Test
public void resolvesTypeParameterReturnType() throws Exception {
RepositoryMetadata metadata = new DummyRepositoryMetadata(ConcreteRepository.class);
Method method = ConcreteRepository.class.getMethod("intermediateMethod");
assertThat(metadata.getReturnedDomainClass(method)).isEqualTo(User.class);
}
Aggregations