데이터 api 를 추출하는 방법

코드 예제

0
0

데이터 api 를 추출하는 방법

We can use .extract then .jsonPath and lastly getString("token")

String myToken =
                
        given()
                .log().all()
                .contentType(ContentType.URLENC)
                .formParam("email","xxxxxxxxxxx")
                .formParam("password","xxxxxxx")
        .when()
                .post("/login")
        .then()
                .log().all()
                .statusCode(200)
                .body("token", is(notNullValue()))
                .contentType(ContentType.JSON)
                .body("token",is(not(emptyString())))
                .extract()
                .jsonPath()
                .getString("token")
        ;

다른 언어로

이 페이지는 다른 언어로되어 있습니다

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................