use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryInformationUnitTests method ignoresDefaultMethod.
// DATACMNS-939
@Test
public void ignoresDefaultMethod() throws SecurityException, NoSuchMethodException {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class);
RepositoryInformation information = new DefaultRepositoryInformation(metadata, CrudRepository.class, RepositoryComposition.just(customImplementation));
Method method = FooRepository.class.getMethod("defaultMethod");
assertThat(information.getQueryMethods()).doesNotContain(method);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryMetadataUnitTests method looksUpIdClassCorrectly.
@Test
public void looksUpIdClassCorrectly() throws Exception {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(UserRepository.class);
assertThat(metadata.getIdType()).isEqualTo(Integer.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryMetadataUnitTests method detectsIdTypeOnIntermediateRepository.
// DATACMNS-442
@Test
public void detectsIdTypeOnIntermediateRepository() {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class);
assertThat(metadata.getIdType()).isEqualTo(Long.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryMetadataUnitTests method looksUpDomainClassCorrectly.
@Test
public void looksUpDomainClassCorrectly() throws Exception {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(UserRepository.class);
assertThat(metadata.getDomainType()).isEqualTo(User.class);
metadata = new DefaultRepositoryMetadata(SomeDao.class);
assertThat(metadata.getDomainType()).isEqualTo(User.class);
}
use of org.springframework.data.repository.core.RepositoryMetadata in project spring-data-commons by spring-projects.
the class DefaultRepositoryMetadataUnitTests method discoversDomainAndIdTypeForIntermediateRepository.
// DATACMNS-501
@Test
public void discoversDomainAndIdTypeForIntermediateRepository() {
RepositoryMetadata metadata = new DefaultRepositoryMetadata(IdTypeFixingRepository.class);
assertThat(metadata.getDomainType()).isEqualTo(Object.class);
assertThat(metadata.getIdType()).isEqualTo(Long.class);
}
Aggregations