Search in sources :

Example 1 with RelationshipRepositoryDecoratorBase

use of io.crnk.core.repository.decorate.RelationshipRepositoryDecoratorBase in project crnk-framework by crnk-project.

the class DecoratorTest method testRelationshipRegistryAwareDecoration.

@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testRelationshipRegistryAwareDecoration() {
    RegistryAwareRelationshipRepository repository = Mockito.mock(RegistryAwareRelationshipRepository.class);
    RelationshipRepositoryDecoratorBase<Schedule, Long, Task, Long> decorator = new RelationshipRepositoryDecoratorBase() {
    };
    decorator.setDecoratedObject(repository);
    ResourceRegistry resourceRegistry = Mockito.mock(ResourceRegistry.class);
    decorator.setResourceRegistry(resourceRegistry);
    Mockito.verify(repository, Mockito.times(1)).setResourceRegistry(Mockito.eq(resourceRegistry));
}
Also used : Task(io.crnk.core.mock.models.Task) RelationshipRepositoryDecoratorBase(io.crnk.core.repository.decorate.RelationshipRepositoryDecoratorBase) Schedule(io.crnk.core.mock.models.Schedule) ResourceRegistry(io.crnk.core.engine.registry.ResourceRegistry) Test(org.junit.Test)

Aggregations

ResourceRegistry (io.crnk.core.engine.registry.ResourceRegistry)1 Schedule (io.crnk.core.mock.models.Schedule)1 Task (io.crnk.core.mock.models.Task)1 RelationshipRepositoryDecoratorBase (io.crnk.core.repository.decorate.RelationshipRepositoryDecoratorBase)1 Test (org.junit.Test)1