use of io.crnk.core.engine.internal.dispatcher.path.JsonPath in project crnk-framework by crnk-project.
the class CollectionGetTest method onGivenRequestCollectionWithIdsGetShouldHandleIt.
@Test
public void onGivenRequestCollectionWithIdsGetShouldHandleIt() {
// GIVEN
JsonPath jsonPath = pathBuilder.build("/tasks/1,2");
CollectionGet sut = new CollectionGet(resourceRegistry, typeParser, documentMapper);
// WHEN
Response response = sut.handle(jsonPath, emptyTaskQuery, null, null);
// THEN
Assert.assertNotNull(response);
}
use of io.crnk.core.engine.internal.dispatcher.path.JsonPath in project crnk-framework by crnk-project.
the class CollectionGetTest method onGivenRequestCollectionGetShouldAcceptIt.
@Test
public void onGivenRequestCollectionGetShouldAcceptIt() {
// GIVEN
JsonPath jsonPath = pathBuilder.build("/tasks/");
CollectionGet sut = new CollectionGet(resourceRegistry, typeParser, documentMapper);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
Assert.assertEquals(result, true);
}
use of io.crnk.core.engine.internal.dispatcher.path.JsonPath in project crnk-framework by crnk-project.
the class CollectionGetTest method onGivenRequestCollectionGetShouldHandleIt.
@Test
public void onGivenRequestCollectionGetShouldHandleIt() {
// GIVEN
JsonPath jsonPath = pathBuilder.build("/tasks/");
CollectionGet sut = new CollectionGet(resourceRegistry, typeParser, documentMapper);
// WHEN
Response response = sut.handle(jsonPath, emptyTaskQuery, null, null);
// THEN
Assert.assertNotNull(response);
}
use of io.crnk.core.engine.internal.dispatcher.path.JsonPath in project crnk-framework by crnk-project.
the class FieldResourcePostTest method onRelationshipRequestShouldDenyIt.
@Test
public void onRelationshipRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks/1/relationships/project");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
FieldResourcePost sut = new FieldResourcePost(resourceRegistry, PROPERTIES_PROVIDER, typeParser, objectMapper, documentMapper, modificationFilters);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
assertThat(result).isFalse();
}
use of io.crnk.core.engine.internal.dispatcher.path.JsonPath in project crnk-framework by crnk-project.
the class RelationshipsResourceGetTest method onNonRelationRequestShouldDenyIt.
@Test
public void onNonRelationRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
RelationshipsResourceGet sut = new RelationshipsResourceGet(resourceRegistry, typeParser, documentMapper);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
assertThat(result).isFalse();
}
Aggregations