use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class FieldResourcePostTest method onNonRelationRequestShouldDenyIt.
@Test
public void onNonRelationRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks");
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.ResourcePath in project crnk-framework by crnk-project.
the class ResourcePatchTest method onNoBodyResourceShouldThrowException.
@Test
public void onNoBodyResourceShouldThrowException() throws Exception {
// GIVEN
ResourcePost sut = new ResourcePost(resourceRegistry, PROPERTIES_PROVIDER, typeParser, objectMapper, documentMapper, modificationFilters);
// THEN
expectedException.expect(RuntimeException.class);
// WHEN
sut.handle(new ResourcePath("fridges"), emptyProjectQuery, null, null);
}
use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class FieldResourceGetTest method onNonRelationRequestShouldDenyIt.
@Test
public void onNonRelationRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
FieldResourceGet sut = new FieldResourceGet(resourceRegistry, typeParser, documentMapper);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
assertThat(result).isFalse();
}
use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class FieldResourceGetTest method onRelationshipRequestShouldDenyIt.
@Test
public void onRelationshipRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks/1/relationships/project");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
FieldResourceGet sut = new FieldResourceGet(resourceRegistry, typeParser, documentMapper);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
assertThat(result).isFalse();
}
use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class RelationshipsResourcePatchTest method onNonRelationRequestShouldDenyIt.
@Test
public void onNonRelationRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
RelationshipsResourcePatch sut = new RelationshipsResourcePatch(resourceRegistry, typeParser, modificationFilters);
// WHEN
boolean result = sut.isAcceptable(jsonPath, REQUEST_TYPE);
// THEN
assertThat(result).isFalse();
}
Aggregations