use of io.crnk.core.repository.RelationshipMatcher in project crnk-framework by crnk-project.
the class OppositeFowardingRelationshipRepositoryTest method setup.
@Before
public void setup() {
MockRepositoryUtil.clear();
CrnkBoot boot = new CrnkBoot();
boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
boot.setServiceUrlProvider(new ConstantServiceUrlProvider(ResourceRegistryTest.TEST_MODELS_URL));
boot.boot();
resourceRegistry = boot.getResourceRegistry();
testRepository = (RelationIdTestRepository) resourceRegistry.getEntry(RelationIdTestResource.class).getResourceRepository().getResourceRepository();
RelationshipMatcher relMatcher = new RelationshipMatcher().rule().source(RelationIdTestResource.class).target(RelationIdTestResource.class).add();
relRepository = new ForwardingRelationshipRepository(RelationIdTestResource.class, relMatcher, ForwardingDirection.OPPOSITE, ForwardingDirection.OPPOSITE);
relRepository.setResourceRegistry(resourceRegistry);
}
Aggregations