Skip to content

Commit

Permalink
test: null 여부 확인 로직 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
kimyu0218 committed Dec 1, 2024
1 parent 6ce9a1d commit 4021363
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/com/nexters/goalpanzi/acceptance/AcceptanceStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.nexters.goalpanzi.domain.mission.DayOfWeek;
import com.nexters.goalpanzi.domain.mission.TimeOfDay;
import com.nexters.goalpanzi.presentation.auth.dto.GoogleLoginRequest;
import com.nexters.goalpanzi.presentation.member.dto.UpdateDeviceTokenRequest;
import com.nexters.goalpanzi.presentation.member.dto.UpdateProfileRequest;
import com.nexters.goalpanzi.presentation.mission.dto.CreateMissionRequest;
import com.nexters.goalpanzi.presentation.mission.dto.JoinMissionRequest;
Expand All @@ -19,6 +20,7 @@
import java.time.LocalDateTime;
import java.util.List;

import static com.nexters.goalpanzi.fixture.MemberFixture.DEVICE_TOKEN;
import static com.nexters.goalpanzi.fixture.MissionFixture.DESCRIPTION;
import static com.nexters.goalpanzi.fixture.TokenFixture.BEARER;

Expand Down Expand Up @@ -142,4 +144,16 @@ public class AcceptanceStep {
.then().log().all()
.extract();
}

public static ExtractableResponse<Response> 디바이스_토큰_갱신(String accessToken) {
UpdateDeviceTokenRequest request = new UpdateDeviceTokenRequest(DEVICE_TOKEN);
return RestAssured.given().log().all()
.contentType(MediaType.APPLICATION_JSON_VALUE)
.header(HttpHeaders.AUTHORIZATION, BEARER + accessToken)
.body(request)
.when().patch("/api/member/device-token")
.then().log().all()
.statusCode(HttpStatus.OK.value())
.extract();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ public class MemberAcceptanceTest extends AcceptanceTest {
@Test
void 푸시_알림_활성화_여부를_수정한다() {
LoginResponse login = 구글_로그인(new GoogleLoginRequest(EMAIL_HOST)).as(LoginResponse.class);
디바이스_토큰_갱신(login.accessToken());

UpdatePushActivationStatusRequest request = new UpdatePushActivationStatusRequest(true);
RestAssured.given().log().all()
Expand Down

0 comments on commit 4021363

Please sign in to comment.