use of io.crnk.core.boot.CrnkBoot in project crnk-framework by crnk-project.
the class HttpRequestContextAwareTest method check.
@Test
public void check() throws IOException {
HttTestModule testModule = Mockito.mock(HttTestModule.class);
CrnkBoot boot = new CrnkBoot();
boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://localhost:8080"));
boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
boot.addModule(testModule);
boot.boot();
Mockito.verify(testModule, Mockito.times(1)).setHttpRequestContextProvider(Mockito.any(HttpRequestContextProvider.class));
}
use of io.crnk.core.boot.CrnkBoot in project crnk-framework by crnk-project.
the class ResourceFieldContributorTest method setup.
@Before
public void setup() {
MockRepositoryUtil.clear();
contributedRepository = Mockito.spy(new ContributorRelationshipRepository());
SimpleModule testModule = new SimpleModule("test");
testModule.addRepository(new TaskRepository());
testModule.addRepository(new ProjectRepository());
testModule.addRepository(new ProjectToTaskRepository());
testModule.addRepository(contributedRepository);
boot = new CrnkBoot();
boot.setServiceDiscovery(new TestServiceDiscovery());
boot.addModule(testModule);
boot.boot();
}
use of io.crnk.core.boot.CrnkBoot in project crnk-framework by crnk-project.
the class PathBuilderTest method prepare.
@Before
public void prepare() {
CrnkBoot boot = new CrnkBoot();
boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
boot.setServiceUrlProvider(new ConstantServiceUrlProvider(ResourceRegistryTest.TEST_MODELS_URL));
boot.boot();
pathBuilder = new PathBuilder(boot.getResourceRegistry());
RegistryEntry entry = boot.getResourceRegistry().findEntry(Task.class);
ResourceRepositoryInformation repositoryInformation = entry.getRepositoryInformation();
repositoryInformation.getActions().put("someRepositoryAction", Mockito.mock(RepositoryAction.class));
repositoryInformation.getActions().put("someResourceAction", Mockito.mock(RepositoryAction.class));
}
use of io.crnk.core.boot.CrnkBoot in project crnk-framework by crnk-project.
the class ControllerRegistryTest method prepare.
@Before
public void prepare() {
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();
}
use of io.crnk.core.boot.CrnkBoot in project crnk-framework by crnk-project.
the class ConstraintViolationImplTest method setup.
@Before
public void setup() {
boot = new CrnkBoot();
boot.addModule(ValidationModule.create());
boot.setServiceDiscovery(new ReflectionsServiceDiscovery("io.crnk.validation.mock.repository"));
boot.boot();
errorData = Mockito.spy(new ErrorDataBuilder().setDetail("testMessage").addMetaField(ConstraintViolationExceptionMapper.META_RESOURCE_TYPE, "tasks").setSourcePointer("name").build());
ResourceRegistry resourceRegistry = boot.getResourceRegistry();
violation = ConstraintViolationImpl.fromError(resourceRegistry, errorData);
}
Aggregations