{
"class": [
"com.adp.vantage.reference.todo.resource.ApplicationContextResource"
],
"properties": {
"$siren4j.class": "com.adp.vantage.reference.todo.resource.ApplicationContextResource"
},
"actions": [
{
"name": "list:get",
"method": "GET",
"href": "/rest/v1/todo/lists/{listId}",
"title": "Get a Todo Lists",
"type": "application/x-www-form-urlencoded",
"fields": [
{
"name": "id",
"type": "TEXT",
"required": true,
"max": -1,
"min": -1,
"maxLength": -1
}
]
}
],
"links": [
{
"rel": [
"baseUri"
],
"href": "http://localhost"
},
{
"rel": [
"todoContextResource"
],
"href": "/rest/v1/todo"
}
]
}
@Test
public void testFilterBehavior() {
// What is the expected behavior here? Result seems to be an array, but that
// doesn't work either.
assertThat(json, hasJsonPath("$.actions[?(@.name == 'list:get')].method", is("GET")));
}
@Test
public void testFilterBehaviorAsArray() {
// What is the expected behavior here? Result seems to be an array, but that
// doesn't work either.
assertThat(json, hasJsonPath("$.actions[?(@.name == 'list:get')].method[0]", is("GET")));
}
@Test
public void testFilterBehaviorTryingLast() {
// What is the expected behavior here? Result seems to be an array, but that
// doesn't work either.
assertThat(json, hasJsonPath("$.actions[?(@.name == 'list:get')].method[-1:]", is("GET")));
}