Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Deploy] jisungin.co.kr 배포 설정 #25

Merged
merged 4 commits into from
Mar 23, 2024

Conversation

pdohyung
Copy link
Member

💡 연관된 이슈

close #19

📝 작업 내용

  • jisungin.co.kr로 배포 설정 했습니다.
  • Dockerfile과 docker-compose.yml을 추가했습니다.
  • Github Actions Jobs를 추가했습니다.

💬 리뷰 요구 사항

커밋 내용에서 질문이나 의견 있으시면 남겨주세요 !

@pdohyung pdohyung added the 🌏 Deploy 배포 관련 label Mar 23, 2024
@pdohyung pdohyung self-assigned this Mar 23, 2024
@pdohyung pdohyung linked an issue Mar 23, 2024 that may be closed by this pull request
2 tasks
Copy link
Member

@AHNYUNKI AHNYUNKI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨네요! 도형님!!

Copy link
Member

@jwooo jwooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!!

Comment on lines -1 to -130
}

@Test
@DisplayName("책을 조회한다.")
public void getBook() {
// given
Book book = bookRepository.save(create());

// when
BookResponse response = bookService.getBook(book.getIsbn());

// then
assertThat(response.getDateTime()).isEqualTo(book.getDateTime());
assertThat(response.getAuthors()).hasSize(2)
.contains("도서 저자1", "도서 저자2");
assertThat(response)
.extracting("title", "content", "isbn", "publisher", "url", "thumbnail")
.contains("도서 제목", "도서 내용", "123456789X", "도서 출판사", "도서 URL", "도서 썸네일");
}

@Test
@DisplayName("isbn이 일치하는 책이 없는 경우 예외가 발생한다.")
public void getBookWithInvalidIsbn() {
// given
Book book = bookRepository.save(create());
String invalidIsbn = "0000000000";

// when // then
assertThatThrownBy(() -> bookService.getBook(invalidIsbn))
.isInstanceOf(BusinessException.class)
.hasMessage("책을 찾을 수 없습니다.");
}

@Test
@DisplayName("도서 정보에 대한 책을 생성한다.")
public void createBook() {
// given
LocalDateTime registeredDateTime = LocalDateTime.now();

BookCreateServiceRequest request = BookCreateServiceRequest.builder()
.title("도서 제목")
.contents("도서 내용")
.isbn("123456789X")
.dateTime(registeredDateTime)
.authors("도서 저자1, 도서 저자2")
.publisher("도서 출판사")
.url("도서 URL")
.thumbnail("도서 썸네일")
.build();

// when
BookResponse response = bookService.createBook(request);

// then
assertThat(response.getDateTime()).isEqualTo(registeredDateTime);
assertThat(response.getAuthors()).hasSize(2)
.contains("도서 저자1", "도서 저자2");
assertThat(response)
.extracting("title", "content", "isbn", "publisher", "url", "thumbnail")
.contains("도서 제목", "도서 내용", "123456789X", "도서 출판사", "도서 URL", "도서 썸네일");
}

@Test
@DisplayName("isbn이 일치하는 책을 생성하는 경우 예외가 발생한다.")
public void createBookWithDuplicateIsbn() {
// given
Book book = create();
bookRepository.save(book);

BookCreateServiceRequest request = BookCreateServiceRequest.builder()
.title("도서 제목")
.contents("도서 내용")
.isbn("123456789X")
.dateTime(LocalDateTime.now())
.authors("도서 저자1, 도서 저자2")
.publisher("도서 출판사")
.url("도서 URL")
.thumbnail("도서 썸네일")
.build();

// when // then
assertThatThrownBy(() -> bookService.createBook(request))
.isInstanceOf(BusinessException.class)
.hasMessage("이미 등록된 책 정보 입니다.");
}

private static Book create() {
return Book.builder()
.title("도서 제목")
.content("도서 내용")
.authors("도서 저자1, 도서 저자2")
.isbn("123456789X")
.dateTime(LocalDateTime.now())
.publisher("도서 출판사")
.url("도서 URL")
.thumbnail("도서 썸네일")
.build();
}

}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다. 추후 수정하겠습니다.

@pdohyung pdohyung changed the title [Deploy] jisungin.co.kr 배포 설정 [Deploy] jisungin.co.kr 배포 설정 Mar 23, 2024
@pdohyung pdohyung merged commit aa5a04f into develop Mar 23, 2024
1 check passed
@pdohyung pdohyung deleted the deploy/19-jisungincokr-deploy branch March 23, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌏 Deploy 배포 관련
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Deploy] jisungin.co.kr 배포 설정
3 participants