-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 중복 없이 MemoryFilter 가져오도록 수정 * test: 대소문자 검증 테스트케이스 추가 * fix: 요청 쿼리 스트링 파싱 사 NPE 문제 해결 * chore: dev 서버 중복 워크 플로우 비활성화 * refactor: ! 연산 제거 * refactor: 조건문 변경 * test: displayName 변경 * test: displayName 변경
- Loading branch information
Showing
8 changed files
with
94 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...ub/workflows/backend-ci-cd-multi-prod.yml → ...hub/workflows/backend-ci-cd-multi-dev.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Backend CI/CD multi prod | ||
name: Backend CI/CD multi dev | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
backend/src/test/java/com/staccato/memory/service/dto/request/MemoryReadRequestTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package com.staccato.memory.service.dto.request; | ||
|
||
import java.util.List; | ||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.NullAndEmptySource; | ||
import com.staccato.memory.service.MemoryFilter; | ||
import com.staccato.memory.service.MemorySort; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
class MemoryReadRequestTest { | ||
@DisplayName("필터가 주어졌을 때 올바른 필터 목록을 반환한다") | ||
@Test | ||
void getFiltersWithValidFilters() { | ||
// given | ||
MemoryReadRequest request = new MemoryReadRequest("TERM, term", "NEWEST"); | ||
|
||
// when | ||
List<MemoryFilter> filters = request.getFilters(); | ||
|
||
// then | ||
assertThat(filters).hasSize(1).containsOnly(MemoryFilter.TERM); | ||
} | ||
|
||
@DisplayName("필터가 주어지지 않았을 때 빈 필터 목록을 반환한다") | ||
@ParameterizedTest | ||
@NullAndEmptySource | ||
void getFiltersWithNullOrEmptyFilters(String filters) { | ||
// given | ||
MemoryReadRequest request = new MemoryReadRequest(filters, "NEWEST"); | ||
|
||
// when | ||
List<MemoryFilter> result = request.getFilters(); | ||
|
||
// then | ||
assertThat(result).isEmpty(); | ||
} | ||
|
||
@DisplayName("정렬이 주어지지 않았을 때 기본 정렬 기준을 반환한다") | ||
@ParameterizedTest | ||
@NullAndEmptySource | ||
void getSortWithNullOrEmptyFilters(String sort) { | ||
// given | ||
MemoryReadRequest request = new MemoryReadRequest(null, sort); | ||
|
||
// when | ||
MemorySort result = request.getSort(); | ||
|
||
// then | ||
assertThat(result).isEqualTo(MemorySort.UPDATED); | ||
} | ||
} |