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

통합 테스트를 포함하고 컨트롤러를 리팩토링 #7

Closed
wants to merge 28 commits into from

Commits on Feb 29, 2024

  1. Configuration menu
    Copy the full SHA
    3d9dcae View commit details
    Browse the repository at this point in the history
  2. ✨ Feat : 새로운 기능 추가

    🐛 Fix : 버그 수정
    🔧 Modify : 파일/폴더 수정/삭제/위치변경
    🎨 Style : 코드 포맷 변경, 세미 콜론 누락, 의미 없는 코드 수정
    💄 Design : CSS등 사용자 UI/UX 디자인 변경
    🤖 Refactor : 코드 리팩토링
    📝 Docs : 문서 수정
    💡 Comment : 필요한 주석 추가 및 변경
    ✅ Test : 테스트 코드 추가
    🚚 Chore : 빌드 업무 수정, 패키지 관리자 구성 업데이트 등 환경설정 관련사항
    
    📝 Docs : 문서 수정
    레이어드 아키텍처에 따른 기능 목록 작성
    haxr369 committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    620d197 View commit details
    Browse the repository at this point in the history
  3. ✅ Test : 테스트 코드 추가

    구현되지 않은 기능에 대한 테스트 주석처리
    haxr369 committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    60cb7de View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2024

  1. 📝 Docs : 문서 수정

    역할에 따라 기능 목록 수정
    1. 데이터 유효성 검사는 각 데이터 저장 클래스나 레코드가 담당
    2. ErrorException은 계층에 따라 나누기 애매하기 때문에 util로 분리
    3. 당첨 번호와 보너스 번호 저장을 위해 사용했던 클래스 NanumLotto에서 LottoCompany로 이름 수정
    haxr369 committed Mar 1, 2024
    Configuration menu
    Copy the full SHA
    35b56da View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2024

  1. ✨ Feat : 새로운 기능 추가

    📝 Docs : 문서 수정
    
    1. Customer class에 싱글톤 패턴을 적용해서 Application Layer의 여러 클래스가 동일한 값에 접근할 수 있도록함.
    2. 피드백에 따라 docs/Readme.md를 수정
    3. 예외를 처리하기 위해 ExceptionStatus를 정의
    haxr369 committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    6fd1c50 View commit details
    Browse the repository at this point in the history
  2. ✨ Feat : 새로운 기능 추가

    📝 Docs : 문서 수정
    ✅ Test : 테스트 코드 추가
    
    1. Lotto record에 유효성 검사 로직 추가
    2. Lotto 유효성 검사 로직 테스트 추가
    haxr369 committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    798dd51 View commit details
    Browse the repository at this point in the history
  3. ✨ Feat : 새로운 기능 추가

    ✅ Test : 테스트 코드 추가
    
    1. Customer 클래스 필드에 getter 붙임
        - lottos 필드에는 setter를 붙였는데 객체 생성 이후에 lottos 필드를 초기화하기 위함.
    2. LottoCompany 싱글톤 생성
    3. LottoCompany의 당첨 번호와 Lotto의 생성 번호의 유효성 검사 로직이 중복되어 LottoValidator가 획일적으로 관리
    haxr369 committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    83a1377 View commit details
    Browse the repository at this point in the history

Commits on Mar 3, 2024

  1. ✨ Feat : 새로운 기능 추가

    📝 Docs : 문서 수정
    
    1. Winnings enum 클래스 생성 - 당첨금과 코멘트를 저장
    2. Winnings는 데이터를 저장하기 보단 유용하게 사용되는 클래스기 때문에 Util 패키지로 옮김 그에 따라  Readme도 수정
    haxr369 committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    ff16439 View commit details
    Browse the repository at this point in the history
  2. ✨ Feat : 새로운 기능 추가

    🤖 Refactor : 코드 리팩토링
    💡 Comment : 필요한 주석 추가 및 변경
    ✅ Test : 테스트 코드 추가
    
    1. 객체의 독립성을 위해 Customer를 singleton 패턴으로 생성하는 대신 record로 관리
    2. 그에 따라 CustomTest 수정
    3. Lottogenerator 생성과 createCustomer 메서드 작성 그리고 정상동작을 테스트
    4. InputManager와 OutputManager를 둬서 추후 입출력 구현을 수정할 수 있도록함
    haxr369 committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    399d63e View commit details
    Browse the repository at this point in the history
  3. ✨ Feat : 새로운 기능 추가

    1. Lotto에 toString 오버라이드
    2. LottoGenerator에 createLottos 메서드 생성 역할 분리를 위해 로또 1개를 생성하는 createLotto도 private으로 생성
    haxr369 committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    1f14e7d View commit details
    Browse the repository at this point in the history
  4. ✨ Feat : 새로운 기능 추가

    1. 로또 게임 동작 완료
    2. LottoGenerator 와 LottoResultCalculator 테스트 수행 필요
    3. Winnings enum에 valueOfWinningsAndBonus를 추가해서 당첨 번호와 보너스 번호로 등수 찾기 기능 제공
    haxr369 committed Mar 3, 2024
    Configuration menu
    Copy the full SHA
    cba7969 View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2024

  1. ✨ Feat : 새로운 기능 추가

    ✅ Test : 테스트 코드 추가
    
    LottoCompany를 생성할 때 로또 개수를 6개가 아니게 입력하면 예외가 발생하도록 수정 및 테스트 작성
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    554a306 View commit details
    Browse the repository at this point in the history
  2. 🐛 Fix : 버그 수정

    🤖 Refactor : 코드 리팩토링
    
    1. LottoManager에 필드에 객체 생성하는 것 보다는 로컬 변수로 저장
    2. 로직으로 이미 충분히 Lotto의 제약사항을 만족할 수 있기 때문에 try - catch 문 제거
    3. InputManager와 OutputManager를 필드로 둬서 LottoResultCalculator와 LottoGenerator 클래스 안에 메서드가 공통적으로 입력받는 인자 제거
    4. Winnings enum에서 newWinningsMap에서 생성하는 Map은 입력 순서를 보장하는 LinkedHashMap을 사용
    5. SystemOutputManager는 요구사항을 맞추기 위해 "당첨 통계"를 출력하도록 함
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    df2957b View commit details
    Browse the repository at this point in the history
  3. 🤖 Refactor : 코드 리팩토링

    1.
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    36f273a View commit details
    Browse the repository at this point in the history
  4. 🤖 Refactor : 코드 리팩토링

    1. Winnings와 LottoResultCalculator.checkWinningElement 메서드를 읽기 쉽게 수정
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    cd23699 View commit details
    Browse the repository at this point in the history
  5. 🤖 Refactor : 코드 리팩토링

    1. LottoGenerator와 LottoResultCalculator는 데이터를 이용한 비즈니스 로직을 처리하기 때문에 model/service로 변경
    2. 사용자의 입력을 검사하고 비즈니스 로직을 통제하는 LottoController에서 사용자 입력 유효성 검사 수행
    3. 당첨 번호와 보너스 번호를 저장하는 클래스의 이름을 LottoCompany에서 PrizeNumbers로 변경
    4. 모든 유효성 검사 로직을 LottoVaildator에 위치시키고 해당하는 테스트 작성
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    c9ad654 View commit details
    Browse the repository at this point in the history
  6. ✅ Test : 테스트 코드 추가

    1. LottoGenerator와 LotoResultCalculator의 메서드 인자를 더 간소화시켜서 테스트 용이성 증대
    2. LottoGenerator와 LotoResultCalculator의 퍼블릭 메서드에 대해 테스트 작성
    haxr369 committed Mar 5, 2024
    Configuration menu
    Copy the full SHA
    377490a View commit details
    Browse the repository at this point in the history

Commits on Mar 9, 2024

  1. 🤖 Refactor : 코드 리팩토링

    1. Winnings 리팩토링 시작
    haxr369 committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    8d5f953 View commit details
    Browse the repository at this point in the history
  2. 🤖 Refactor : 코드 리팩토링

    1. Money DTO 생성
    2. Lotto에게 로또 구매를 위한 Money 유효성 검사 역할 부여
    haxr369 committed Mar 9, 2024
    Configuration menu
    Copy the full SHA
    bfdca44 View commit details
    Browse the repository at this point in the history

Commits on Mar 10, 2024

  1. 🤖 Refactor : 코드 리팩토링

    1. 당첨 번호와 보너스 번호의 유효성 검사를 PrizeNumbers에게 역할을 재배치
    haxr369 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    92c356f View commit details
    Browse the repository at this point in the history
  2. 🤖 Refactor : 코드 리팩토링

    ✅ Test : 테스트 코드 추가
    
    1. 수정된 Winnings에 맞게 LottoResultCalculator를 수정
    2. Lotto에 유효성 검사 역할을 부여하고 그에 맞는 테스트 코드 작성
    3. 출력을 작성할 때 당첨 통계를 보여줄 수 있도록 수정
    haxr369 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    0609483 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bcbcf52 View commit details
    Browse the repository at this point in the history
  4. java version 17로 수정

    haxr369 committed Mar 10, 2024
    Configuration menu
    Copy the full SHA
    592a003 View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2024

  1. ✅ Test : 테스트 코드 추가

    1. 사용자 입력에 대한 테스트 작성
    haxr369 committed Mar 11, 2024
    Configuration menu
    Copy the full SHA
    c0f09fc View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2024

  1. 🤖 Refactor : 코드 리팩토링

    ✅ Test : 테스트 코드 추가
    
    1. LottoGenerator 내부에서 Random을 생성하기 때문에 테스트하기 어려움 따라서 외부에서 Random 객체를 주입하는 방식 사용
    2. Mockito를 이용해서 Random 클래스의 모킹 객체 생성
    3. 사용자 입출력에 대한 대체 방법 제시
    4. 통합 테스트를 위한 모든준비가 끝났다.
    haxr369 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    afa5871 View commit details
    Browse the repository at this point in the history
  2. ✅ Test : 테스트 코드 추가

    1. Controller를 위한 통합 테스트 작성
    2. Input 받는 방식을 테스트가 용이하기 위해 Scanner를 주입 받아 사용하도록 수정
    haxr369 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    912243a View commit details
    Browse the repository at this point in the history
  3. 🤖 Refactor : 코드 리팩토링

    ✅ Test : 테스트 코드 추가
    
    1. 컨트롤러에서 람다식을 이용해 사용자 입력 받는 로직과 유효성 검사하는 로직을 분리. 추후에 유효성을 검사하는 로직이 바뀌면 다른 로직을 주입하면 되기 때문에 더 유연함.
    2. 통합 테스트를 통해 리팩토링한 컨트롤러의 동작을 검사
    haxr369 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    2015f02 View commit details
    Browse the repository at this point in the history
  4. 🤖 Refactor : 코드 리팩토링

    1. Lotto와 관련된 예외를 모아서 model 패키지로 이동
    2. Money에 존재하는 예외 메시지는 Lotto와 관련있지 않고 Money Dto 그 자체적인 정의기 때문에 따로 빼두지 않음
    haxr369 committed Mar 12, 2024
    Configuration menu
    Copy the full SHA
    f5ccb88 View commit details
    Browse the repository at this point in the history