Jacobvu84 / restassured-serenity

0 stars 0 forks source link

04 - Kịch bản đầu tiên #4

Open Jacobvu84 opened 4 years ago

Jacobvu84 commented 4 years ago
package com.linecorp.screenplay.features;

import org.junit.Test;
import org.junit.runner.RunWith;

import io.restassured.response.Response;
import net.serenitybdd.junit.runners.SerenityRunner;
import net.serenitybdd.rest.SerenityRest;

@RunWith(SerenityRunner.class)
public class WhenGettingTheApplicationStory {

    private Response response;

    @Test
    public void shouldBeExecutedSuccesfully() {

        response = SerenityRest.when().get("https://api.iextrading.com/1.0/stock/aapl/book");
        response.then().assertThat().statusCode(200);
    }

}
Jacobvu84 commented 4 years ago

Trong file pom.xml

Add thêm

        <dependency>
            <groupId>net.serenity-bdd</groupId>
            <artifactId>serenity-rest-assured</artifactId>
            <version>${serenity.version}</version>
        </dependency>