Skip to content

Commit

Permalink
refactor(repository): FakeRepository에 null을 반환하는 findAll 메서드 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
jminkkk committed Aug 21, 2024
1 parent d8c3345 commit 22562ad
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.http.HttpStatus;

import codezap.global.exception.CodeZapException;
Expand Down Expand Up @@ -37,7 +38,6 @@ public boolean existsByCategoryId(Long categoryId) {
return templates.stream().anyMatch(template -> Objects.equals(template.getCategory().getId(), categoryId));
}

@Override
public Page<Template> searchBy(Long memberId, String keyword, Pageable pageable) {
List<Template> searchedTemplates = templates.stream()
.filter(template -> Objects.equals(template.getMember().getId(), memberId))
Expand All @@ -47,7 +47,6 @@ public Page<Template> searchBy(Long memberId, String keyword, Pageable pageable)
return pageTemplates(pageable, searchedTemplates);
}

@Override
public Page<Template> searchBy(Long memberId, String keyword, List<Long> templateIds, Pageable pageable) {
List<Template> searchedTemplates = templates.stream()
.filter(template -> Objects.equals(template.getMember().getId(), memberId))
Expand All @@ -58,7 +57,6 @@ public Page<Template> searchBy(Long memberId, String keyword, List<Long> templat
return pageTemplates(pageable, searchedTemplates);
}

@Override
public Page<Template> searchBy(Long memberId, String keyword, Long categoryId, Pageable pageable) {
List<Template> searchedTemplates = templates.stream()
.filter(template -> Objects.equals(template.getMember().getId(), memberId))
Expand All @@ -69,7 +67,6 @@ public Page<Template> searchBy(Long memberId, String keyword, Long categoryId, P
return pageTemplates(pageable, searchedTemplates);
}

@Override
public Page<Template> searchBy(Long memberId, String keyword, Long categoryId, List<Long> templateIds,
Pageable pageable
) {
Expand Down Expand Up @@ -113,6 +110,11 @@ public List<Template> findByMemberId(Long id) {
.toList();
}

@Override
public Page<Template> findAll(Specification<Template> specification, Pageable pageable) {
return null;
}

@Override
public Template save(Template entity) {
var saved = new Template(
Expand Down

0 comments on commit 22562ad

Please sign in to comment.