From dc427f5654e1f5166d9588031b9d35791008f5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:12:15 +0900 Subject: [PATCH 01/15] Update README.md --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 05a04f9..fd12503 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ ## [NEXTSTEP 플레이그라운드의 미션 진행 과정](https://github.com/next-step/nextstep-docs/blob/master/playground/README.md) --- -1. 피드백 강의 전까지 미션 진행 -> 피드백 강의 전까지 혼자 힘으로 미션 진행. 미션을 진행하면서 하나의 작업이 끝날 때 마다 add, commit -> 예를 들어 다음 숫자 야구 게임의 경우 0, 1, 2단계까지 구현을 완료한 후 push. 개인 레포지토리, 개인 브랜치에서 진행. +1. 피드백 강의 전까지 미션 진행 +- 피드백 강의 전까지 혼자 힘으로 미션 진행, 미션을 진행하면서 하나의 작업이 끝날 때 마다 add, commit + - 예를 들어 다음 숫자 야구 게임의 경우 각 미션 별 `branch`를 로컬 저장소로 `clone` 한 후 미션을 해결 한 뒤 `PR`을 보냅니다. + - 코드 수정이 더 이상 일어나지 않을 경우 리뷰어를 설정하고 다음 미션을 진행 합니다. ![mission baseball](https://raw.githubusercontent.com/next-step/nextstep-docs/master/playground/images/mission_baseball.png) --- -2. 피드백 앞 단계까지 미션 구현을 완료한 후 피드백 강의를 학습한다. +2. 피드백 앞 단계까지 미션 구현을 완료한 후 피드백 강의를 학습합니다. --- -3. (임시로 만들어본 규칙입니다) 자신의 브랜치에 구현해둔 코드를 피드백을 참고해 수정해본다. -해당 코드를 본 레포지토리의 main으로 합병하는 PR을 요청해 팀원들의 피드백을 받는다. +3. 자신의 브랜치에 구현해둔 코드를 피드백을 참고해 수정해봅니다. +- 해당 코드를 본 레포지토리의 main으로 합병하는 PR을 요청해 팀원들의 피드백을 받습니다. From 0e949f59a2d8640d293336a0fc15eae13b4fa73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Sat, 22 Jun 2024 16:13:45 +0900 Subject: [PATCH 02/15] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fd12503..bdd03e9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ --- 1. 피드백 강의 전까지 미션 진행 - 피드백 강의 전까지 혼자 힘으로 미션 진행, 미션을 진행하면서 하나의 작업이 끝날 때 마다 add, commit - - 예를 들어 다음 숫자 야구 게임의 경우 각 미션 별 `branch`를 로컬 저장소로 `clone` 한 후 미션을 해결 한 뒤 `PR`을 보냅니다. + - `main` 미션 레포지토리를 본인의 로컬 저장소로 `clone` 하여 프로젝트 환경을 구성합니다. + - 예를 들어 다음 숫자 야구 게임의 경우 각 미션 별 `branch`를 `pull` 받은 후 미션을 해결 한 뒤 `PR`을 보냅니다. - 코드 수정이 더 이상 일어나지 않을 경우 리뷰어를 설정하고 다음 미션을 진행 합니다. ![mission baseball](https://raw.githubusercontent.com/next-step/nextstep-docs/master/playground/images/mission_baseball.png) @@ -13,5 +14,5 @@ --- 3. 자신의 브랜치에 구현해둔 코드를 피드백을 참고해 수정해봅니다. -- 해당 코드를 본 레포지토리의 main으로 합병하는 PR을 요청해 팀원들의 피드백을 받습니다. +- 해당 코드를 본 레포지토리의 `main`으로 합병하는 `PR`을 요청해 팀원들의 피드백을 받습니다. From 8be5c6d713e0c1d9b42924e4307a3ac2308e1c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:01:03 +0900 Subject: [PATCH 03/15] chore: add auto-assign reviewer reuses workflow --- .github/workflows/auto-reviewer.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .github/workflows/auto-reviewer.yml diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml new file mode 100644 index 0000000..5067827 --- /dev/null +++ b/.github/workflows/auto-reviewer.yml @@ -0,0 +1,8 @@ +name: "Auto Assign Reviewer" +on: + pull_request: + types: [opened, reopened] + +jobs: + call-auto-assign: + uses: java-playground-hiking/.github/.github/workflows/auto-assign-reviewer.yml@main From 96eea971aefe7d595220e1bb55785216fb371d86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:03:25 +0900 Subject: [PATCH 04/15] update: modify to refference file path --- .github/workflows/auto-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index 5067827..34c30ec 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -5,4 +5,4 @@ on: jobs: call-auto-assign: - uses: java-playground-hiking/.github/.github/workflows/auto-assign-reviewer.yml@main + uses: java-playground-hiking/.github/.github/workflows/auto-reviewer.yml@main From 862eeb16c80da7ed5773e3d95291b229672396dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:25:17 +0900 Subject: [PATCH 05/15] update: auto reviewer workflow does not reusing --- .github/workflows/auto-reviewer.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index 34c30ec..eac4875 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -1,8 +1,12 @@ -name: "Auto Assign Reviewer" -on: - pull_request: - types: [opened, reopened] + name: 'Auto Assign Reviewer' + on: + pull_request: + types: [opened, reopened] -jobs: - call-auto-assign: - uses: java-playground-hiking/.github/.github/workflows/auto-reviewer.yml@main + jobs: + add-reviews: + runs-on: ubuntu-latest + steps: + - uses: kentaro-m/auto-assign-action@v2 + with: + configuration-path: .github/config-auto-assign.yml From 11378371c185b0e36202724bfa55db60afbc56b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:26:11 +0900 Subject: [PATCH 06/15] chore: add auto reviewer configuration file --- .github/config-auto-assign.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/config-auto-assign.yml diff --git a/.github/config-auto-assign.yml b/.github/config-auto-assign.yml new file mode 100644 index 0000000..827fccd --- /dev/null +++ b/.github/config-auto-assign.yml @@ -0,0 +1,9 @@ +addReviewers: true +addAssignees: false + +reviewers: + - ohdeng02 + - rigyeonghong + - JoHyoju04 + +numberOfReviewers: 1 From 7491571f0f6c7c663380eb100d57044de8cc36a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 16:28:07 +0900 Subject: [PATCH 07/15] update: specific version --- .github/workflows/auto-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index eac4875..2575176 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -7,6 +7,6 @@ add-reviews: runs-on: ubuntu-latest steps: - - uses: kentaro-m/auto-assign-action@v2 + - uses: kentaro-m/auto-assign-action@v2.0.0 with: configuration-path: .github/config-auto-assign.yml From 3b42fc5167514c2b524217357fd715de1e0641d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:06:38 +0900 Subject: [PATCH 08/15] update: change git action workflow --- .github/workflows/auto-reviewer.yml | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index 2575176..f41f552 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -1,12 +1,15 @@ - name: 'Auto Assign Reviewer' - on: - pull_request: - types: [opened, reopened] +name: Review Assign - jobs: - add-reviews: - runs-on: ubuntu-latest - steps: - - uses: kentaro-m/auto-assign-action@v2.0.0 - with: - configuration-path: .github/config-auto-assign.yml +on: + pull_request: + types: [opened, reopened] + +jobs: + assign: + runs-on: ubuntu-latest + steps: + - uses: hkusu/review-assign-action@v1.4.0 + with: + assignees: ${{ github.actor }} + reviewers: ohdeng02, rigyeonghong, JoHyoju04, LeeJuHwan + ready-comment: 'Ready for review :ok:' From 4a3da5944d324d5cb7657a0f44f9063ef5872c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:23:16 +0900 Subject: [PATCH 09/15] Delete .github/config-auto-assign.yml --- .github/config-auto-assign.yml | 9 --------- 1 file changed, 9 deletions(-) delete mode 100644 .github/config-auto-assign.yml diff --git a/.github/config-auto-assign.yml b/.github/config-auto-assign.yml deleted file mode 100644 index 827fccd..0000000 --- a/.github/config-auto-assign.yml +++ /dev/null @@ -1,9 +0,0 @@ -addReviewers: true -addAssignees: false - -reviewers: - - ohdeng02 - - rigyeonghong - - JoHyoju04 - -numberOfReviewers: 1 From bd390ece8014b32bc296362966bdbc1f71e6e8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:24:19 +0900 Subject: [PATCH 10/15] update: display result --- .github/workflows/auto-reviewer.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index f41f552..e44c32b 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -11,5 +11,11 @@ jobs: - uses: hkusu/review-assign-action@v1.4.0 with: assignees: ${{ github.actor }} - reviewers: ohdeng02, rigyeonghong, JoHyoju04, LeeJuHwan - ready-comment: 'Ready for review :ok:' + reviewers: | + ohdeng02 + rigyeonghong + JoHyoju04 + LeeJuHwan + - name: Show result + if: always() + run: echo '${{ steps.assign.outputs.result }}' # success or failure From 7965892e39faa73d673e3293d463964de3e9dec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 17:46:23 +0900 Subject: [PATCH 11/15] update: ignore reviewers --- .github/workflows/auto-reviewer.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index e44c32b..4c9ee3b 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -11,11 +11,7 @@ jobs: - uses: hkusu/review-assign-action@v1.4.0 with: assignees: ${{ github.actor }} - reviewers: | - ohdeng02 - rigyeonghong - JoHyoju04 - LeeJuHwan + reviewers: ${{ vars.REVIEWERS }} - name: Show result if: always() run: echo '${{ steps.assign.outputs.result }}' # success or failure From 3957447db4938e51e6c4ee349dde56399bf01bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:39:53 +0900 Subject: [PATCH 12/15] update: modify pr target --- .github/workflows/auto-reviewer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index 4c9ee3b..3fc8700 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -2,7 +2,7 @@ name: Review Assign on: pull_request: - types: [opened, reopened] + types: [opened, ready_for_review] jobs: assign: From c8b21af1ae1599fa804a261ec1df5e44edad9d3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=A3=BC=ED=99=98?= <118493627+LeeJuHwan@users.noreply.github.com> Date: Thu, 27 Jun 2024 18:42:16 +0900 Subject: [PATCH 13/15] update: remove display results --- .github/workflows/auto-reviewer.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-reviewer.yml b/.github/workflows/auto-reviewer.yml index 3fc8700..5990c70 100644 --- a/.github/workflows/auto-reviewer.yml +++ b/.github/workflows/auto-reviewer.yml @@ -8,10 +8,8 @@ jobs: assign: runs-on: ubuntu-latest steps: - - uses: hkusu/review-assign-action@v1.4.0 + - uses: hkusu/review-assign-action@v1 with: assignees: ${{ github.actor }} reviewers: ${{ vars.REVIEWERS }} - - name: Show result - if: always() - run: echo '${{ steps.assign.outputs.result }}' # success or failure + max-num-of-reviewers: 1 From 9eb95246453f9e52a0a6244ea0b695b89100e79c Mon Sep 17 00:00:00 2001 From: rigyeonghong Date: Sat, 20 Jul 2024 09:36:31 +0900 Subject: [PATCH 14/15] String Test --- src/test/java/study/SetTest.java | 2 ++ src/test/java/study/StringTest.java | 35 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/test/java/study/SetTest.java diff --git a/src/test/java/study/SetTest.java b/src/test/java/study/SetTest.java new file mode 100644 index 0000000..81b24a5 --- /dev/null +++ b/src/test/java/study/SetTest.java @@ -0,0 +1,2 @@ +package study;public class SetTest { +} diff --git a/src/test/java/study/StringTest.java b/src/test/java/study/StringTest.java index 43e47d9..3ea08d5 100644 --- a/src/test/java/study/StringTest.java +++ b/src/test/java/study/StringTest.java @@ -1,8 +1,11 @@ package study; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy; +import static org.junit.jupiter.api.Assertions.assertThrows; public class StringTest { @Test @@ -10,4 +13,36 @@ void replace() { String actual = "abc".replace("b", "d"); assertThat(actual).isEqualTo("adc"); } + + @Test + @DisplayName("\"1,2\"을 ,로 split 했을 때 1과 2로 잘 분리되는지 검사") + void split1() { + String[] actual = "1,2".split(","); + assertThat(actual).contains("1","2"); + } + + @Test + @DisplayName("\"1\"을 ,로 split 했을 때 1만을 포함하는 배열이 반환되는지 검사") + void split2() { + String[] actual = "1".split(","); + assertThat(actual).containsExactly("1"); + } + + @Test + @DisplayName("(1,2) 값에서 () 제거 후 반환 검사") + void substring() { + String actual = "(1,2)"; + String result = actual.substring(1, actual.length() - 1); + assertThat(result).isEqualTo("1,2"); + } + + @Test + @DisplayName("문자열의 특정 위치의 문자를 가져올 때, 인덱스를 벗어나면 예외 발생") + void charAt() { + String actual = "abc"; + assertThatThrownBy(() -> { + actual.charAt(20); + }).isInstanceOf(IndexOutOfBoundsException.class) + .hasMessageContaining("String index out of range"); + } } From 6217e7bfe26cd926621cdbff3340ca4a70877fed Mon Sep 17 00:00:00 2001 From: rigyeonghong Date: Sat, 20 Jul 2024 10:36:26 +0900 Subject: [PATCH 15/15] Set Test --- src/test/java/study/SetTest.java | 62 +++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/src/test/java/study/SetTest.java b/src/test/java/study/SetTest.java index 81b24a5..1116565 100644 --- a/src/test/java/study/SetTest.java +++ b/src/test/java/study/SetTest.java @@ -1,2 +1,62 @@ -package study;public class SetTest { +package study; + +import jdk.internal.joptsimple.internal.Strings; +import org.assertj.core.internal.Integers; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; +import org.junit.jupiter.params.provider.ValueSource; + +import java.util.HashSet; +import java.util.Set; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class SetTest { + private Set numbers; + + @BeforeEach + void setUp() { + numbers = new HashSet<>(); + numbers.add(1); + numbers.add(1); + numbers.add(2); + numbers.add(3); + } + + @Test + @DisplayName("HashSet의 크기 확인") + void testHashSetSize() { + assertThat(numbers.size()).isEqualTo(3); + } + + @Test + void contains() { + assertThat(numbers.contains(1)).isTrue(); + assertThat(numbers.contains(2)).isTrue(); + assertThat(numbers.contains(3)).isTrue(); + } + + @ParameterizedTest + @ValueSource(ints = {1,2,3}) + @DisplayName("1,2,3 존재하는지 확인") + void testContainValue(int number) { + assertTrue(numbers.contains(number)); + } + + @ParameterizedTest + @CsvSource(value = { + "1, true", + "2, true", + "3, true", + "4, false", + "5, false"}, delimiter = ',') + @DisplayName("존재하는 값은 true, 아닌 값은 false 반환하는지 확인") + void testIsContainValue(int number, boolean expectedResult) { + assertThat(numbers.contains(number)).isEqualTo(expectedResult); + } }