use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class ResourceDeleteTest method onNonRelationRequestShouldDenyIt.
@Test
public void onNonRelationRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks/1/relationships/project");
ResourceRegistry resourceRegistry = mock(ResourceRegistry.class);
ResourceDelete sut = new ResourceDelete(resourceRegistry, new ArrayList<ResourceModificationFilter>());
// 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 ResourcePostTest method onNonExistentResourceShouldThrowException.
@Test
public void onNonExistentResourceShouldThrowException() throws Exception {
// GIVEN
Document newProjectBody = new Document();
Resource data = createProject();
data.setType("fridges");
newProjectBody.setData(Nullable.of((Object) data));
ResourcePost sut = new ResourcePost(resourceRegistry, PROPERTIES_PROVIDER, typeParser, objectMapper, documentMapper, modificationFilters);
// THEN
expectedException.expect(RepositoryNotFoundException.class);
// WHEN
sut.handle(new ResourcePath("fridges"), emptyTaskQuery, null, newProjectBody);
}
use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath 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.ResourcePath 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();
}
use of io.crnk.core.engine.internal.dispatcher.path.ResourcePath in project crnk-framework by crnk-project.
the class RelationshipsResourceGetTest method onFieldRequestShouldDenyIt.
@Test
public void onFieldRequestShouldDenyIt() {
// GIVEN
JsonPath jsonPath = new ResourcePath("tasks/1/project");
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