@Test
public void testLookupActionsActions() throws Exception {

    // given
    final String firstDataSetId = testClient.createDataset("dataset/dataset.csv", "testDataset");
    final String dataSetId = testClient.createDataset("dataset/dataset_cars.csv", "cars");
    final String thirdDataSetId = testClient.createDataset("dataset/dataset.csv", "third");
    List<String> expectedIds = Arrays.asList(dataSetId, firstDataSetId, thirdDataSetId);
    // when
    final String actions = when().get("/api/datasets/{id}/actions", dataSetId).asString();
    // then
    final JsonNode jsonNode = mapper.readTree(actions);
    // response is an array
    assertTrue("json not an array:" + actions, jsonNode.isArray());
    Assertions.assertThat(jsonNode.isArray()).isTrue();
    // an array of 2 entries
    ArrayNode lookups = (ArrayNode) jsonNode;
    assertThat(lookups.size(), is(3));
    // let's check the url of the possible lookups
    for (int i = 0; i < lookups.size(); i++) {
        final JsonNode lookup = lookups.get(i);
        final ArrayNode parameters = (ArrayNode) lookup.get("parameters");
        for (int j = 0; j < parameters.size(); j++) {
            final JsonNode parameter = parameters.get(j);
            if (StringUtils.equals(parameter.get("name").asText(), "url")) {
                final String url = parameter.get("default").asText();
                // the url id must be known
                assertThat(expectedIds.stream().filter(url::contains).count(), is(1L));
            }
        }
    }
}