Search in sources :

Example 1 with AbilityAcceptanceFixture

use of wooteco.prolog.fixtures.AbilityAcceptanceFixture in project prolog by woowacourse.

the class AbilityStepDefinitions method 자식역량을추가하면.

@When("{string}의 자식역량 {string}(을)(를) 추가하(면)(고)")
public void 자식역량을추가하면(String parentAbility, String childAbility) {
    AbilityAcceptanceFixture fixture = AbilityAcceptanceFixture.findByName(childAbility);
    Long parentAbilityId = getAbilityIdByName(parentAbility);
    AbilityCreateRequest request = fixture.toCreateRequestWithParentId(parentAbilityId);
    context.invokeHttpPostWithToken("/abilities", request);
    if (context.response.statusCode() == HttpStatus.OK.value()) {
        context.storage.put(childAbility, context.response.as(HierarchyAbilityResponse.class));
    }
}
Also used : DefaultAbilityCreateRequest(wooteco.prolog.ability.application.dto.DefaultAbilityCreateRequest) AbilityCreateRequest(wooteco.prolog.ability.application.dto.AbilityCreateRequest) AbilityAcceptanceFixture(wooteco.prolog.fixtures.AbilityAcceptanceFixture) HierarchyAbilityResponse(wooteco.prolog.ability.application.dto.HierarchyAbilityResponse) When(io.cucumber.java.en.When)

Example 2 with AbilityAcceptanceFixture

use of wooteco.prolog.fixtures.AbilityAcceptanceFixture in project prolog by woowacourse.

the class AbilityStepDefinitions method 부모역량을추가하면.

@When("부모역량 {string}(을)(를) 추가하(면)(고)")
public void 부모역량을추가하면(String abilityName) {
    AbilityAcceptanceFixture fixture = AbilityAcceptanceFixture.findByName(abilityName);
    AbilityCreateRequest request = fixture.toCreateRequestWithParentId(null);
    context.invokeHttpPostWithToken("/abilities", request);
    if (context.response.statusCode() == HttpStatus.OK.value()) {
        context.storage.put(abilityName, context.response.as(HierarchyAbilityResponse.class));
    }
}
Also used : DefaultAbilityCreateRequest(wooteco.prolog.ability.application.dto.DefaultAbilityCreateRequest) AbilityCreateRequest(wooteco.prolog.ability.application.dto.AbilityCreateRequest) AbilityAcceptanceFixture(wooteco.prolog.fixtures.AbilityAcceptanceFixture) HierarchyAbilityResponse(wooteco.prolog.ability.application.dto.HierarchyAbilityResponse) When(io.cucumber.java.en.When)

Aggregations

When (io.cucumber.java.en.When)2 AbilityCreateRequest (wooteco.prolog.ability.application.dto.AbilityCreateRequest)2 DefaultAbilityCreateRequest (wooteco.prolog.ability.application.dto.DefaultAbilityCreateRequest)2 HierarchyAbilityResponse (wooteco.prolog.ability.application.dto.HierarchyAbilityResponse)2 AbilityAcceptanceFixture (wooteco.prolog.fixtures.AbilityAcceptanceFixture)2