Search in sources :

Example 6 with FieldResourceGet

use of io.crnk.core.engine.internal.dispatcher.controller.FieldResourceGet in project crnk-framework by crnk-project.

the class FieldResourceGetTest method onValidRequestShouldAcceptIt.

@Test
public void onValidRequestShouldAcceptIt() {
    // GIVEN
    JsonPath jsonPath = pathBuilder.build("tasks/1/project");
    ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
    FieldResourceGet sut = new FieldResourceGet(resourceRegistry, typeParser, documentMapper);
    // WHEN
    boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
    // THEN
    assertThat(result).isTrue();
}
Also used : FieldResourceGet(io.crnk.core.engine.internal.dispatcher.controller.FieldResourceGet) ResourceRegistry(io.crnk.core.engine.registry.ResourceRegistry) JsonPath(io.crnk.core.engine.internal.dispatcher.path.JsonPath) BaseControllerTest(io.crnk.core.engine.internal.dispatcher.controller.BaseControllerTest) Test(org.junit.Test)

Aggregations

BaseControllerTest (io.crnk.core.engine.internal.dispatcher.controller.BaseControllerTest)6 FieldResourceGet (io.crnk.core.engine.internal.dispatcher.controller.FieldResourceGet)6 JsonPath (io.crnk.core.engine.internal.dispatcher.path.JsonPath)6 Test (org.junit.Test)6 Response (io.crnk.core.engine.dispatcher.Response)3 ResourceRegistry (io.crnk.core.engine.registry.ResourceRegistry)3 ResourcePath (io.crnk.core.engine.internal.dispatcher.path.ResourcePath)2 Relationship (io.crnk.core.engine.document.Relationship)1 Resource (io.crnk.core.engine.document.Resource)1 ResourceField (io.crnk.core.engine.information.resource.ResourceField)1 ResourceInformation (io.crnk.core.engine.information.resource.ResourceInformation)1 RelationshipRepositoryAdapter (io.crnk.core.engine.internal.repository.RelationshipRepositoryAdapter)1 ResourceRepositoryAdapter (io.crnk.core.engine.internal.repository.ResourceRepositoryAdapter)1 QueryAdapter (io.crnk.core.engine.query.QueryAdapter)1 Project (io.crnk.core.mock.models.Project)1 Task (io.crnk.core.mock.models.Task)1 User (io.crnk.core.mock.models.User)1 QueryParamsAdapter (io.crnk.legacy.internal.QueryParamsAdapter)1 QueryParams (io.crnk.legacy.queryParams.QueryParams)1