Package com.jayway.restassured.response

Examples of com.jayway.restassured.response.Response.asString()


  public void testIncompleteProcessDefinition() {
    setUpMockDefinitionQuery(createIncompleteMockDefinitions());
    Response response = expect().statusCode(Status.OK.getStatusCode())
        .when().get(PROCESS_DEFINITION_QUERY_URL);

    String content = response.asString();
    String returnedResourceName = from(content).getString("[0].resource");
    Assert.assertNull("Should be null, as it is also null in the original process definition on the server.",
        returnedResourceName);
  }
View Full Code Here


    InOrder inOrder = inOrder(mockQuery);
    inOrder.verify(mockQuery).jobId(jobId);
    inOrder.verify(mockQuery).list();

    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals("There should be one job returned.", 1, instances.size());
    Assert.assertNotNull("The returned job should not be null.", instances.get(0));

    String returnedJobId = from(content).getString("[0].id");
View Full Code Here

    Response response = given().pathParam("id", MockProvider.EXAMPLE_PROCESS_INSTANCE_ID)
      .then().expect().statusCode(Status.OK.getStatusCode())
      .when().get(HISTORIC_SINGLE_PROCESS_INSTANCE_URL);

    String content = response.asString();

    String returnedProcessInstanceId = from(content).getString("id");
    String returnedProcessInstanceBusinessKey = from(content).getString("businessKey");
    String returnedProcessDefinitionId = from(content).getString("processDefinitionId");
    String returnedStartTime = from(content).getString("startTime");
View Full Code Here

          .get(HISTORIC_DETAIL_RESOURCE_URL);

    InOrder inOrder = inOrder(mockedQuery);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<String> details = from(content).getList("");
    Assert.assertEquals("There should be two activity instance returned.", 2, details.size());
    Assert.assertNotNull("The returned details should not be null.", details.get(0));
    Assert.assertNotNull("The returned details should not be null.", details.get(1));
View Full Code Here

      .body("_links.processInstance.href", endsWith(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID))
      .body("_links.self.href", endsWith(EXAMPLE_TASK_ID))

      .when().get(SINGLE_TASK_URL);

    String content = response.asString();

    // validate embedded assignees:
    List<Map<String,Object>> embeddedAssignees = from(content).getList("_embedded.assignee");
    Assert.assertEquals("There should be one assignee returned.", 1, embeddedAssignees.size());
    Map<String, Object> embeddedAssignee = embeddedAssignees.get(0);
View Full Code Here

          .statusCode(Status.OK.getStatusCode())
          .contentType(XHTML_XML_CONTENT_TYPE)
      .when()
        .get(RENDERED_FORM_URL);

    String responseContent = response.asString();
    System.out.println(responseContent);
    Assertions.assertThat(responseContent).isEqualTo(expectedResult);
  }

  @Test
View Full Code Here

    InOrder inOrder = inOrder(mockedQuery);
    inOrder.verify(mockedQuery).caseInstanceId(caseInstanceId);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals(1, instances.size());
    Assert.assertNotNull(instances.get(0));

    String returnedCaseInstanceId = from(content).getString("[0].id");
View Full Code Here

    InOrder inOrder = inOrder(mockedHistoricCaseInstanceQuery);
    inOrder.verify(mockedHistoricCaseInstanceQuery).notClosed();
    inOrder.verify(mockedHistoricCaseInstanceQuery).list();

    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals(1, instances.size());
    Assert.assertNotNull(instances.get(0));

    String returnedCaseInstanceId = from(content).getString("[0].id");
View Full Code Here

    InOrder inOrder = inOrder(mockedHistoricCaseInstanceQuery);
    inOrder.verify(mockedHistoricCaseInstanceQuery).notClosed();
    inOrder.verify(mockedHistoricCaseInstanceQuery).list();

    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals(1, instances.size());
    Assert.assertNotNull(instances.get(0));

    String returnedCaseInstanceId = from(content).getString("[0].id");
View Full Code Here

    InOrder inOrder = inOrder(mockedQuery);
    inOrder.verify(mockedQuery).caseInstanceId(caseInstanceId);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<String> instances = from(content).getList("");
    Assert.assertEquals(1, instances.size());
    Assert.assertNotNull(instances.get(0));

    String returnedId = from(content).getString("[0].id");
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.