Package com.jayway.restassured.response

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


      expect().
        statusCode(201).
      when().
        post(REST_PATH + "/mailbox/label?name={labelName}");

    return with(response.asString()).getInt("id");
  }

  /**
   * Parses json response and returns {@link LabelCounters} for Label
   *
 
View Full Code Here


          .get(INCIDENT_QUERY_URL);

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

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

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

    verify(queryMock).operationType(OPERATION_TYPE_CLAIM);
    verify(queryMock).entityType(ENTITY_TYPE_TASK);
    verify(queryMock).property("owner");
    verify(queryMock).list();

    String json = response.asString();
    UserOperationLogEntryDto actual = from(json).getObject("[0]", UserOperationLogEntryDto.class);
    assertEquals(MockProvider.EXAMPLE_USER_OPERATION_LOG_ID, actual.getId());
    assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_ID, actual.getProcessDefinitionId());
    assertEquals(MockProvider.EXAMPLE_PROCESS_DEFINITION_KEY, actual.getProcessDefinitionKey());
    assertEquals(MockProvider.EXAMPLE_PROCESS_INSTANCE_ID, actual.getProcessInstanceId());
View Full Code Here

    InOrder inOrder = inOrder(mockQuery);
    inOrder.verify(mockQuery).taskName(queryName);
    inOrder.verify(mockQuery).list();

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

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

    InOrder inOrder = inOrder(mockQuery);
    inOrder.verify(mockQuery).taskName(queryName);
    inOrder.verify(mockQuery).list();

    // validate embedded tasks
    String content = response.asString();
    List<Map<String,Object>> instances = from(content).getList("_embedded.task");
    Assert.assertEquals("There should be one task returned.", 1, instances.size());
    Assert.assertNotNull("The returned task should not be null.", instances.get(0));

    Map<String, Object> taskObject = instances.get(0);
View Full Code Here

    // assert query invocation
    InOrder inOrder = Mockito.inOrder(mockedQuery);
    inOrder.verify(mockedQuery).processDefinitionKey(queryKey);
    inOrder.verify(mockedQuery).list();

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

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

  public void testIncompleteExecution() {
    setUpMockExecutionQuery(createIncompleteMockExecutions());
    Response response = expect().statusCode(Status.OK.getStatusCode())
        .when().get(EXECUTION_QUERY_URL);

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

    // assert query invocation
    InOrder inOrder = Mockito.inOrder(mockedQuery);
    inOrder.verify(mockedQuery).caseInstanceId(queryCaseInstanceId);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<Map<String, String>> caseInstances = from(content).getList("");

    assertThat(caseInstances).hasSize(1);
    assertThat(caseInstances.get(0)).isNotNull();
View Full Code Here

    // assert query invocation
    InOrder inOrder = Mockito.inOrder(mockedQuery);
    inOrder.verify(mockedQuery).caseInstanceId(queryCaseInstanceId);
    inOrder.verify(mockedQuery).list();

    String content = response.asString();
    List<Map<String, String>> caseInstances = from(content).getList("");

    assertThat(caseInstances).hasSize(1);
    assertThat(caseInstances.get(0)).isNotNull();
View Full Code Here

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

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

    String returnedProcessInstanceId = 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.