/** data set attributes can load values just like report attributes */
  @Test
  public void loadAttributeValues() {
    ObjectNode node = builder.buildDataSetNode(dataSetId, name, description, owner, lastChange);
    node.put(
        "attributes",
        new ObjectMapper()
            .createArrayNode()
            .add(builder.buildAttributeNode(id, name, code, "string")));
    server.register(dataSetsUri + "/" + dataSetId, node.toString());
    DataSet dataSet = service.loadDataSet(dataSetId);
    Attribute attribute = dataSet.getAttributes().get(0);

    String label = "label";
    String value = "value";
    final ObjectNode valueNode = new ObjectMapper().createObjectNode();
    valueNode.put(
        "values",
        new ObjectMapper().createArrayNode().add(builder.buildAttributeValueNode(label, value)));

    server.register(
        dataSetsUri + "/" + dataSetId + "/attributes/" + code + "/values", valueNode.toString());

    List<AttributeValue> values = attribute.getValues().load().get();
    assertEquals(values.size(), 1);

    assertEquals(values.get(0).getLabel(), label);
    assertEquals(values.get(0).getValue(), value);

    assertEquals(attribute.toString(), name);
    assertEquals(values.get(0).toString(), label);
  }
  /** Valid attribute types are parsed correctly. */
  @Test(dataProvider = "attributeTypes")
  public void attributeTypes(String jsonType, AttributeType type) {
    ObjectNode node = builder.buildDataSetNode(dataSetId, name, description, owner, lastChange);
    node.put(
        "attributes",
        new ObjectMapper()
            .createArrayNode()
            .add(builder.buildAttributeNode(id, name, code, jsonType)));
    server.register(dataSetsUri + "/" + dataSetId, node.toString());
    DataSet dataSet = service.loadDataSet(dataSetId);

    assertEquals(dataSet.getAttributes().size(), 1);

    Attribute attribute = dataSet.getAttributes().get(0);
    assertEquals(attribute.getId(), id);
    assertEquals(attribute.getName(), name);
    assertEquals(attribute.getCode(), code);
    assertEquals(attribute.getType(), type);
  }