Skip to content

Commit

Permalink
백엔드 합병 작업 (#593)
Browse files Browse the repository at this point in the history
* feat: 빈 공백 추가

* github pr 자동 할당 기능 설정 (#563)

docs: github pr 자동 할당 기능 설정

* 서포터 피드백 작성 유무 반환 추가, 러너 게시글 조회수 flyway 컬럼명 수정, 서포터 지원자 수 조회시 dto 사용하도록 수정 (#555)

* feat: 러너 게시글의 서포터 피드백 유무 필드(컬럼) 구현

* test: 러너 게시글에 서포터 피드백 유무 컬럼 추가 후 테스트 변경

* feat: 러너 게시글 응답에 서포터 피드백 유무 정보 추가

* chore: 러너 게시글에 서포터 피드백 유무 flyway 테이블 컬럼 추가

* chore: 러너 게시글 조회수 컬럼명 flyway 수정 추가

* style: IsReviewed get 메서드 네이밍 get으로 통일되게 수정

* fix: IsReviewed 내부 값 반환 수정

* test: 테스트 내부 entityManager 사용 후 close 하도록 수정

* refactor: 러너 게시글 식별자값 목록으로 서포터 지원자 수 조회시 매핑된 서포터 지원자 수 객체를 반환하도록 레포지터리 메서드 변경

* refactor: 매핑된 서포터 지원자 수 객체를 사용하도록 서비스, 컨트롤러 변경

* style: 공백 및 개행 스타일 수정

* style: toString 메서드 삭제

* refactor: dto 클래스를 레코드로 변경

* test: entityManager flush, close 순서 변경

* 이미 서포터 리뷰를 작성했으면 예외 반환하도록 함 (#552)

* refactor: 이미 서포터 리뷰를 작성했으면 예외 반환하도록 함

* test: Repository 테스트 추가

* test: 테스트에 em.flush와 em.clear 추가

* style: 예외 메세지 이름 변경

* feat: Feedback 을 하면 isReviewed 속성이 true 가 되도록 변경

* refreshToken 과 accessToken 이 null 일 때 예외 추가 (#564)

* feat: refreshToken 과 accessToken 이 null 일 때 예외 추가

* feat: deploy 에 github branch 설정 추가

* test: AssuredSupport post 에서 필요없는 Application json value 삭제

* feat: CookieValue 에 Nullable 추가

* Merbe deb/BE to feat/559

* feat: max threads 100 으로 변경

* deploy 서브 모듈 리프래쉬 토큰 만료 시간 값 변경 (#573)

chore: deploy 리프래쉬 토큰 만료 시간 값 변경

* 기본 쓰레드 300 으로 변경 (#583)

chore: 쓰레드 300 으로 변경

* 기본 쓰레드(200)으로 변경 및 min spare 100 으로 변경 (#584)

* chore: 쓰레드 300 으로 변경

* refchore: 쓰레드 200 으로 변경 및 min spare 100 으로 변경

* min spare 1로 변경 (#586)

* chore: 쓰레드 300 으로 변경

* refchore: 쓰레드 200 으로 변경 및 min spare 100 으로 변경

* refactor min spare 1로 변경

* 톰캣 쓰레드 관련 설정 롤백 (#587)

* chore: 쓰레드 300 으로 변경

* refchore: 쓰레드 200 으로 변경 및 min spare 100 으로 변경

* refactor min spare 1로 변경

* chore: tomcat 관련 설정 롤백

* 깃허브 소셜 회원 가입시 계정의 닉네임이 없을 경우 기본값으로 저장 (#589)

fix: 사용자 이름 null 로 생성시 기본값 '익명의 사용자'를 사용하도록 수정

---------

Co-authored-by: Ethan <[email protected]>
Co-authored-by: HyunSeo Park (Hyena) <[email protected]>
  • Loading branch information
3 people authored Sep 21, 2023
1 parent 61da099 commit 49ad8d7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion backend/baton/secret
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
@Embeddable
public class MemberName {

private static final String DEFAULT_VALUE = "익명의 사용자";

@Column(name = "name", nullable = false)
private String value;
private String value = DEFAULT_VALUE;

public MemberName(final String value) {
validateNotNull(value);
this.value = value;
}

private void validateNotNull(final String value) {
if (Objects.isNull(value)) {
throw new IllegalArgumentException("MemberName 객체 내부에 name 은 null 일 수 없습니다.");
return;
}
this.value = value;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package touch.baton.infra.auth.oauth.github.response;

import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.annotation.Nullable;
import touch.baton.domain.member.vo.GithubUrl;
import touch.baton.domain.member.vo.ImageUrl;
import touch.baton.domain.member.vo.MemberName;
Expand All @@ -13,7 +14,7 @@

@JsonNaming(SnakeCaseStrategy.class)
public record GithubMemberResponse(String id,
String name,
@Nullable String name,
String login,
String htmlUrl,
String avatarUrl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,21 @@ void success() {
).doesNotThrowAnyException();
}

@DisplayName("이름에 null 이 들어갈 경우 예외가 발생한다.")
@DisplayName("이름에 null 이 들어갈 경우 기본값으로 생성한다.")
@Test
void fail_if_name_is_null() {
assertThatThrownBy(() -> Member.builder()
.memberName(null)
void success_if_name_is_null_then_default_value() {
// given
final Member member = Member.builder()
.memberName(new MemberName(null))
.socialId(new SocialId("testSocialId"))
.oauthId(new OauthId("dsigjh98gh230gn2oinv913bcuo23nqovbvu93b12voi3bc31j"))
.githubUrl(new GithubUrl("github.com/hyena0608"))
.company(new Company("우아한형제들"))
.imageUrl(new ImageUrl("imageUrl"))
.build()
).isInstanceOf(MemberDomainException.class)
.hasMessage("Member 의 name 은 null 일 수 없습니다.");
.build();

// when, then
assertThat(member.getMemberName()).isEqualTo(new MemberName("익명의 사용자"));
}

@DisplayName("socialId에 null 이 들어갈 경우 예외가 발생한다.")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package touch.baton.domain.member.vo;

import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class MemberNameTest {

@DisplayName("value 가 null 이면 기본값으로_생성한다")
@Test
void fail_if_value_is_null_then_default_value() {
// given
final MemberName memberName = new MemberName(null);

// when, then
assertThat(memberName.getValue()).isEqualTo("익명의 사용자");
}
}

This file was deleted.

0 comments on commit 49ad8d7

Please sign in to comment.