Search in sources :

Example 1 with User

use of org.springframework.data.repository.sample.User in project spring-data-commons by spring-projects.

the class RepositoryFactorySupportUnitTests method wrapsExecutionResultIntoListenableFutureIfConfigured.

// DATACMNS-714
@Test
public void wrapsExecutionResultIntoListenableFutureIfConfigured() throws Exception {
    assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true));
    User reference = new User();
    expect(prepareConvertingRepository(reference).findOneByLastname("Foo"), reference);
}
Also used : User(org.springframework.data.repository.sample.User) Test(org.junit.Test)

Example 2 with User

use of org.springframework.data.repository.sample.User in project spring-data-commons by spring-projects.

the class RepositoryFactorySupportUnitTests method wrapsExecutionResultIntoCompletableFutureIfConfigured.

// DATACMNS-714
@Test
public void wrapsExecutionResultIntoCompletableFutureIfConfigured() throws Exception {
    assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true));
    User reference = new User();
    expect(prepareConvertingRepository(reference).findOneByFirstname("Foo"), reference);
}
Also used : User(org.springframework.data.repository.sample.User) Test(org.junit.Test)

Example 3 with User

use of org.springframework.data.repository.sample.User in project spring-data-commons by spring-projects.

the class ResourceReaderRepositoryInitializerUnitTests method emitsRepositoriesPopulatedEventIfPublisherConfigured.

// DATACMNS-224
@Test
public void emitsRepositoriesPopulatedEventIfPublisherConfigured() throws Exception {
    RepositoryPopulator populator = setUpReferenceAndInititalize(new User(), publisher);
    ApplicationEvent event = new RepositoriesPopulatedEvent(populator, repositories);
    verify(publisher, times(1)).publishEvent(event);
}
Also used : User(org.springframework.data.repository.sample.User) ApplicationEvent(org.springframework.context.ApplicationEvent) Test(org.junit.Test)

Example 4 with User

use of org.springframework.data.repository.sample.User in project spring-data-commons by spring-projects.

the class RepositoriesIntegrationTests method returnsPersistentEntityForProxiedClass.

// DATACMNS-376
@Test
public void returnsPersistentEntityForProxiedClass() {
    User user = mock(User.class);
    assertThat(repositories.getPersistentEntity(user.getClass())).isNotNull();
}
Also used : User(org.springframework.data.repository.sample.User) Test(org.junit.Test)

Example 5 with User

use of org.springframework.data.repository.sample.User in project spring-data-commons by spring-projects.

the class RepositoryFactorySupportUnitTests method wrapsExecutionResultIntoListenableFutureWithEntityCollectionIfConfigured.

// DATACMNS-714
@Test
public void wrapsExecutionResultIntoListenableFutureWithEntityCollectionIfConfigured() throws Exception {
    List<User> reference = Collections.singletonList(new User());
    expect(prepareConvertingRepository(reference).readAllByLastname("Foo"), reference);
}
Also used : User(org.springframework.data.repository.sample.User) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 User (org.springframework.data.repository.sample.User)6 ApplicationEvent (org.springframework.context.ApplicationEvent)1