Search in sources :

Example 1 with TokenRequest

use of wooteco.prolog.login.application.dto.TokenRequest in project prolog by woowacourse.

the class Documentation method setUp.

@BeforeEach
public void setUp(RestDocumentationContextProvider restDocumentation) {
    RestAssured.port = port;
    dataInitializer.execute();
    로그인_사용자 = RestAssured.given().log().all().body(new TokenRequest(GithubResponses.소롱.getCode())).contentType(MediaType.APPLICATION_JSON_VALUE).when().post("/login/token").then().log().all().extract().body().as(TokenResponse.class);
    this.spec = new RequestSpecBuilder().addFilter(documentationConfiguration(restDocumentation)).build();
}
Also used : TokenResponse(wooteco.prolog.login.application.dto.TokenResponse) TokenRequest(wooteco.prolog.login.application.dto.TokenRequest) RequestSpecBuilder(io.restassured.builder.RequestSpecBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 2 with TokenRequest

use of wooteco.prolog.login.application.dto.TokenRequest in project prolog by woowacourse.

the class LoginDocumentation method 토큰을_생성한다.

@Test
void 토큰을_생성한다() {
    TokenRequest params = new TokenRequest(GithubResponses.소롱.getCode());
    given("login/token").contentType(MediaType.APPLICATION_JSON_VALUE).body(params).when().post("/login/token").then().log().all().extract().as(TokenResponse.class);
}
Also used : TokenRequest(wooteco.prolog.login.application.dto.TokenRequest) Test(org.junit.jupiter.api.Test)

Aggregations

TokenRequest (wooteco.prolog.login.application.dto.TokenRequest)2 RequestSpecBuilder (io.restassured.builder.RequestSpecBuilder)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 TokenResponse (wooteco.prolog.login.application.dto.TokenResponse)1