Search in sources :

Example 11 with ReflectionsServiceDiscovery

use of io.crnk.core.module.discovery.ReflectionsServiceDiscovery in project crnk-framework by crnk-project.

the class DefaultQueryParamsSerializerTest method setup.

@Before
public void setup() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("http://127.0.0.1"));
    boot.boot();
    resourceRegistry = boot.getResourceRegistry();
    urlBuilder = new JsonApiUrlBuilder(resourceRegistry);
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) JsonApiUrlBuilder(io.crnk.core.engine.internal.utils.JsonApiUrlBuilder) Before(org.junit.Before)

Example 12 with ReflectionsServiceDiscovery

use of io.crnk.core.module.discovery.ReflectionsServiceDiscovery in project crnk-framework by crnk-project.

the class DefaultQueryParamsSerializerTest method testPort.

@Test
public void testPort() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("https://127.0.0.1:1234"));
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(MockConstants.TEST_MODELS_PACKAGE));
    boot.boot();
    resourceRegistry = boot.getResourceRegistry();
    urlBuilder = new JsonApiUrlBuilder(boot.getResourceRegistry());
    check("https://127.0.0.1:1234/tasks", null, new QueryParams());
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) JsonApiUrlBuilder(io.crnk.core.engine.internal.utils.JsonApiUrlBuilder) Test(org.junit.Test)

Example 13 with ReflectionsServiceDiscovery

use of io.crnk.core.module.discovery.ReflectionsServiceDiscovery in project crnk-framework by crnk-project.

the class DefaultQuerySpecSerializerTest method testHttpsSchema.

@Test
public void testHttpsSchema() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("https://127.0.0.1"));
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(String.format("%s,io.crnk.core.queryspec.pagingspec", MockConstants.TEST_MODELS_PACKAGE)));
    boot.boot();
    urlBuilder = new JsonApiUrlBuilder(boot.getResourceRegistry());
    check("https://127.0.0.1/tasks", null, new QuerySpec(Task.class));
}
Also used : Task(io.crnk.core.mock.models.Task) CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) JsonApiUrlBuilder(io.crnk.core.engine.internal.utils.JsonApiUrlBuilder) Test(org.junit.Test)

Example 14 with ReflectionsServiceDiscovery

use of io.crnk.core.module.discovery.ReflectionsServiceDiscovery in project crnk-framework by crnk-project.

the class DefaultQuerySpecSerializerTest method testPort.

@Test
public void testPort() {
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider("https://127.0.0.1:1234"));
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(String.format("%s,io.crnk.core.queryspec.pagingspec", MockConstants.TEST_MODELS_PACKAGE)));
    boot.boot();
    urlBuilder = new JsonApiUrlBuilder(boot.getResourceRegistry());
    check("https://127.0.0.1:1234/tasks", null, new QuerySpec(Task.class));
}
Also used : Task(io.crnk.core.mock.models.Task) CrnkBoot(io.crnk.core.boot.CrnkBoot) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) JsonApiUrlBuilder(io.crnk.core.engine.internal.utils.JsonApiUrlBuilder) Test(org.junit.Test)

Example 15 with ReflectionsServiceDiscovery

use of io.crnk.core.module.discovery.ReflectionsServiceDiscovery in project crnk-framework by crnk-project.

the class AbstractDocumentMapperTest method setup.

@Before
public void setup() {
    MockRepositoryUtil.clear();
    CrnkBoot boot = new CrnkBoot();
    boot.setServiceDiscovery(new ReflectionsServiceDiscovery(String.format("%s,io.crnk.core.queryspec.pagingspec", MockConstants.TEST_MODELS_PACKAGE)));
    boot.setServiceUrlProvider(new ConstantServiceUrlProvider(ResourceRegistryTest.TEST_MODELS_URL));
    boot.setPropertiesProvider(getPropertiesProvider());
    boot.boot();
    objectMapper = boot.getObjectMapper();
    moduleRegistry = boot.getModuleRegistry();
    mapper = boot.getDocumentMapper();
    resourceRegistry = boot.getResourceRegistry();
    resourceFilterDirectory = boot.getModuleRegistry().getContext().getResourceFilterDirectory();
}
Also used : CrnkBoot(io.crnk.core.boot.CrnkBoot) ReflectionsServiceDiscovery(io.crnk.core.module.discovery.ReflectionsServiceDiscovery) ConstantServiceUrlProvider(io.crnk.core.engine.url.ConstantServiceUrlProvider) Before(org.junit.Before)

Aggregations

ReflectionsServiceDiscovery (io.crnk.core.module.discovery.ReflectionsServiceDiscovery)30 CrnkBoot (io.crnk.core.boot.CrnkBoot)28 ConstantServiceUrlProvider (io.crnk.core.engine.url.ConstantServiceUrlProvider)25 Before (org.junit.Before)22 Test (org.junit.Test)7 JsonApiUrlBuilder (io.crnk.core.engine.internal.utils.JsonApiUrlBuilder)6 RegistryEntry (io.crnk.core.engine.registry.RegistryEntry)5 Task (io.crnk.core.mock.models.Task)5 SimpleModule (io.crnk.core.module.SimpleModule)4 RelationIdTestResource (io.crnk.core.mock.models.RelationIdTestResource)3 PathBuilder (io.crnk.core.engine.internal.dispatcher.path.PathBuilder)2 PropertiesProvider (io.crnk.core.engine.properties.PropertiesProvider)2 ResourceRegistry (io.crnk.core.engine.registry.ResourceRegistry)2 Project (io.crnk.core.mock.models.Project)2 Schedule (io.crnk.core.mock.models.Schedule)2 User (io.crnk.core.mock.models.User)2 ProjectRepository (io.crnk.core.mock.repository.ProjectRepository)2 ScheduleRepositoryImpl (io.crnk.core.mock.repository.ScheduleRepositoryImpl)2 TaskRepository (io.crnk.core.mock.repository.TaskRepository)2 Module (io.crnk.core.module.Module)2