Package com.jayway.restassured.response

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


      .body(EXAMPLE_VARIABLE_KEY, notNullValue())
      .body(EXAMPLE_VARIABLE_KEY + ".value", equalTo(EXAMPLE_VARIABLE_VALUE.getValue()))
      .body(EXAMPLE_VARIABLE_KEY + ".type", equalTo(VariableTypeHelper.toExpectedValueTypeName(EXAMPLE_VARIABLE_VALUE.getType())))
      .when().get(SINGLE_TASK_VARIABLES_URL);

    Assert.assertEquals("Should return exactly one variable", 1, response.jsonPath().getMap("").size());
  }

  @Test
  public void testGetLocalObjectVariables() {
    // given
View Full Code Here


            .statusCode(200)
            .log().ifError()
        .when()
            .get("/resource/{id}/schedules");

        JsonPath jsonPath = response.jsonPath();
        int definitionId = jsonPath.getInt("[0].definitionId");

        return definitionId;
    }
View Full Code Here

            .statusCode(200)
            .log().ifError()
        .when()
            .get("/resource/{rid}/schedules");

        JsonPath jp = r.jsonPath();
        numericScheduleId = jp.getInt("[0].scheduleId");
        numericScheduleDefinitionId = jp.getInt("[0].definitionId");
        defaultInterval = jp.getLong("[0].collectionInterval");
        scheduleName = jp.getString("[0].scheduleName");
    }
View Full Code Here

            .statusCode(200)
            .log().ifError()
        .when()
            .get("/resource/{rid}/schedules");

        JsonPath jp = r.jsonPath();
        int tsId = jp.getInt("[0].scheduleId");

        String trait = "{\"value\":\"Hello World!\" }";
        given()
            .header(acceptJson)
View Full Code Here

           // .header("Link", allOf(containsString("page=2"), containsString("current")))
            .header("Link", not(containsString("prev")))
            .body("links.self", notNullValue())
        .when()
            .get("/resource/" + _platformId + "/children");
        JsonPath jsonPath = r.jsonPath();
        assert jsonPath.getList("").size() == 2;
    }

    @Test
    public void testGetResourcesWithPaging() throws Exception {
View Full Code Here

                .header("Content-Type","application/json")
                .header("Accept","application/json")
            .expect().statusCode(201)
            .when().post("/resource/platform/api-test-dummy").andReturn();

        String platformId = response.jsonPath().getString("resourceId");

        given().pathParam("id",platformId)
            .expect().statusCode(HttpStatus.SC_NO_CONTENT)
            .when().delete("/resource/{id}");
    }
View Full Code Here

            .expect()
                .statusCode(201)
            .when()
                .post("/resource/platform/api-test-dummy");

        String platformId = response.jsonPath().getString("resourceId");

        try {
            with().body("{\"value\":\"CPU\"}") // Type of new resource
                .header("Content-Type", "application/json")
                .header("Accept", "application/json")
View Full Code Here

                .statusCode(201)
                .log().ifError()
            .when()
                .post("/resource/platforms");

        String platformId = response.jsonPath().getString("resourceId");

        Resource child = new Resource();
        child.setResourceName("test");
        child.setTypeName("CPU");
        child.setPluginName("Platforms");
View Full Code Here

                    .get(location);

                status = response.getStatusCode();
            }

            createdResourceId = response.jsonPath().getInt("resourceId");

            System.out.flush();
            System.out.println("\n  Resource is created, resource Id = " + createdResourceId + " \n");
            System.out.flush();
            // TODO validate resource configuration once our rest api can tell us
View Full Code Here

                    .get(location);

                status = response.getStatusCode();
            }

            createdResourceId = response.jsonPath().getInt("resourceId");

            System.out.flush();
            System.out.println("\n  Resource is created, resource Id = " + createdResourceId + " \n");
            System.out.flush();
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.