Ejemplo n.º 1
0
  /** Used by other methods to add a custom {@link Task} object. */
  private static Task task(
      String taskId,
      String name,
      String description,
      String status,
      String operation,
      String operationName,
      String startTime) {
    Task task =
        Task.builder()
            .error(Error.builder().build())
            .org(Reference.builder().build())
            .owner(Reference.builder().build())
            .user(Reference.builder().build())
            .params(null)
            .progress(0)
            .status(status)
            .operation(operation)
            .operationName(operationName)
            .startTime(dateService.iso8601DateParse(startTime))
            .endTime(null)
            .expiryTime(null)
            .tasks(Sets.<Task>newLinkedHashSet())
            .description(description)
            .name(name)
            .id("urn:vcloud:" + taskId)
            .href(URI.create(endpoint + "/task/" + taskId))
            .links(Sets.<Link>newLinkedHashSet())
            .build();

    return task;
  }
  @DataProvider
  public Iterator<Object[]> getIllegalPointerData() {
    final Set<Object[]> set = Sets.newHashSet();

    for (final JsonNode node : illegal) set.add(mungeArguments(node));

    return set.iterator();
  }
  private static Iterator<Object[]> nodeToDataProvider(final JsonNode node) {
    final Map<String, JsonNode> map = JacksonUtils.asMap(node);

    final Set<Object[]> set = Sets.newHashSet();

    for (final Map.Entry<String, JsonNode> entry : map.entrySet())
      set.add(new Object[] {entry.getKey(), entry.getValue()});

    return set.iterator();
  }