fix : delete apiTest file.

This commit is contained in:
minseokkang
2022-11-09 14:18:14 +09:00
parent 27f13bbff0
commit ec029964d9
2 changed files with 5 additions and 37 deletions

View File

@@ -1,31 +0,0 @@
name: auto API test
on:
push:
branches: [ "master" ]
jobs:
real-world-api-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: chmod test file
run: chmod +x ./doc/run-api-tests.sh
- name: run api test
run: ./doc/run-api-tests.sh

View File

@@ -24,7 +24,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@@ -45,12 +44,12 @@ public class ArticleServiceImpl implements ArticleService {
@Override @Override
public List<ArticleResponse> getArticles(UserAuth userAuth, ArticleParam articleParam) { public List<ArticleResponse> getArticles(UserAuth userAuth, ArticleParam articleParam) {
Pageable pageable = null;
List<Article> articles = new ArrayList<>();
if (articleParam.getOffset() != null) { List<Article> articles = new ArrayList<>();
pageable = PageRequest.of(articleParam.getOffset(), articleParam.getLimit()); Integer offset = articleParam.getOffset() == null ? 0 : articleParam.getOffset();
} Integer limit = articleParam.getLimit() == null ? 20 : articleParam.getLimit();
Pageable pageable = PageRequest.of(offset,limit);
if (articleParam.getTag() != null) { if (articleParam.getTag() != null) {
articles = articleRepository.findByTag(articleParam.getTag(), pageable); articles = articleRepository.findByTag(articleParam.getTag(), pageable);